-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Dict
function type arguments to Mapping
#3121
Comments
If I understand this correctly, this change in the - sources: t.Optional[t.Dict[str, str | exp.Query]] = None,
+ sources: t.Optional[t.Mapping[str, str | exp.Query]] = None, |
I believe so. But I'm surprised there isn't an warning/error thrown by the FWIW, I'm using |
mypy does complain if I run it against your example, we just probably didn't have a use case where the dictionary was actually restricted to only |
When writing
sqlglot
code againstpyright
, I encounter errors in my local IDE. The argument types forlineage
(and probably others) are too narrow w.r.t.Dict
/Mapping
types.From https://docs.python.org/3/library/typing.html#typing.Dict:
Fully reproducible code snippet
Results in the following error:
The text was updated successfully, but these errors were encountered: