https://dagster.io/ logo
#ask-ai
Title
# ask-ai
a

Alan Bohannon

02/08/2024, 5:30 PM
@Scout Why doesn’t dagster support the type hints from the Typing library?
s

Scout

02/08/2024, 5:30 PM
Based on the documentation, we do support type hints from the Python
typing
library in many cases. However, there are some limitations and specific issues that have been reported regarding the use of certain type hints from the
typing
library with Dagster. For instance, there is an open issue where Dagster does not work with using the
|
operator in place of
Union
for type hints, as allowed by [PEP 604](https://peps.python.org/pep-0604/). This is a newer feature in Python, and it seems that Dagster's type system has not yet been updated to support this syntax. The issue is tracked on GitHub, and users are encouraged to provide a 👍 to help prioritize the issue. Another open issue mentions problems with using
typing.Literal
type annotations. The error reported indicates that Dagster does not recognize
typing.Literal
as a valid type for type checking, which suggests that there may be limitations in how Dagster's type system integrates with the
typing
module. Additionally, there is an issue related to the use of
typing.Mapping
in type annotations, which also seems to be unsupported by Dagster at the moment. These issues indicate that while Dagster does support type hints from the
typing
library in general, there are specific cases where compatibility is not yet fully realized. The Dagster team is aware of these issues, and they are being tracked for resolution. If you are encountering problems with type hints from the
typing
library, it would be helpful to check the Dagster GitHub issues to see if it is a known problem and to provide feedback or additional details that could assist in resolving the issue.
2 Views