Pyright type error supplying SQLAlchemy NVARCHAR length #10573
Closed
Philip Nye (philipnye)
started this conversation in
General
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Pyright is raising a type error when I include a length for the NVARCHAR column in the below script:
Specifically, it raises
Argument of type "dict[str, type[UNIQUEIDENTIFIER[_UUID_RETURN@UNIQUEIDENTIFIER]] | NVARCHAR]" cannot be assigned to parameter "dtype" of type "DtypeArg | None" in function "to_sql".If I remove the
lengthparameter onNVARCHARthe error goes away, but I need to be able to specify the length.I'm fairly new to using type hints. Before I raise a GH issue, is anyone able to tell me if this is an issue in Pyright/an issue in SQLAlchemy/something I've implemented incorrectly.
Thanks in advance.
All reactions