Skip to content

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

Open
@jace

Description

@jace

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] = ...,

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @jace

      Issue actions

        DDL().execute_if(dialect='...') has incorrect type definition · Issue #181 · dropbox/sqlalchemy-stubs