Skip to content
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

DDL().execute_if(dialect='...') has incorrect type definition #181

Open
jace opened this issue Oct 21, 2020 · 0 comments · May be fixed by #219
Open

DDL().execute_if(dialect='...') has incorrect type definition #181

jace opened this issue Oct 21, 2020 · 0 comments · May be fixed by #219

Comments

@jace
Copy link

jace commented Oct 21, 2020

mypy raised an error on this code:

DDL(stmt).execute_if(dialect='postgresql')

error: Argument "dialect" to "execute_if" of "DDLElement" has incompatible type "str"; expected "Optional[Dialect]"

However, the documentation for this method and source code suggest that the expected type is:

Optional[Union[str, Tuple[str, ...], List[str], Set[str]]].

Location of problem:

def execute_if(self: _DDLE, dialect: Optional[Dialect] = ..., callable_: Optional[_DDLCallable] = ...,

philpep added a commit to philpep/sqlalchemy-stubs that referenced this issue Jun 11, 2021
@philpep philpep linked a pull request Jun 11, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant