Skip to content

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions