-
Notifications
You must be signed in to change notification settings - Fork 76
Open
Labels
type: bugConcrete, reproducible bugsConcrete, reproducible bugs
Description
Push adapters (potentially all adapters, haven't checked) are normalizing annotation arguments even if they are not within a csp.ts object.
Describe the bug
To Reproduce
from datetime import datetime, timedelta
from typing import Dict, TypeVar
import csp
from csp.impl.pushadapter import PushInputAdapter
from csp.impl.wiring import py_push_adapter_def
T = TypeVar("T")
class _AdapterImpl(PushInputAdapter):
def __init__(self, ts_typ: T): # noqa
print(ts_typ)
raise
def start(self, starttime: datetime, endtime: datetime):
pass
def stop(self):
pass
MyPushAdapter = py_push_adapter_def(
"adapter_def",
_AdapterImpl,
csp.ts[T],
ts_typ=T,
)
@csp.graph
def my_graph() -> csp.ts[Dict[str, int]]:
data = MyPushAdapter(ts_typ=Dict[str,int])
return data
csp.run(my_graph, starttime=datetime.utcnow(), endtime=timedelta())Prints: class <dict> instead of typing.Dict[str, int]
Expected behavior
Should print typing.Dict[str, int]
Error Message
Runtime Environment
0.11.1
3.11.11 (main, Jan 30 2025, 14:30:53) [GCC 13.3.0]
linux
Additional context
Metadata
Metadata
Assignees
Labels
type: bugConcrete, reproducible bugsConcrete, reproducible bugs