skrawcz commented on code in PR #617:
URL: https://github.com/apache/burr/pull/617#discussion_r2659610067
##########
burr/core/action.py:
##########
@@ -62,6 +62,18 @@
except ImportError:
pass
+try:
+ UnionType = types.UnionType
+except AttributeError: # py<3.10
+ UnionType = None
+
+if typing.TYPE_CHECKING:
+ StreamingPydanticType = Any
+else:
+ StreamingPydanticType = Union[Type["BaseModel"], Type[dict]]
+ if UnionType is not None:
+ StreamingPydanticType = Union[Type["BaseModel"], Type[dict], UnionType]
Review Comment:
doing Any for typing checking will of course work and is cheating...
I think we shouldn't have a typing.TYPE_CHECKING part here, and instead I
think the fix is line 74 + 75.
note I had to do this `stream_type: Union[Type["BaseModel"], Type[dict],
type, "types.UnionType"],` for my pyright in the IDE to not complain -- i.e.
the quotes part.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]