Skip to content

Optional arguments in pyi file are considered positional by mypy #895

Description

@cblegare

Describe the bug

In the pyi files, some arguments marked as Optional miss a default value, and thus are considered positional (hence required) by mypy.

Expected behavior

Keyword and optional arguments should be annotated as such.

To Reproduce

Write a migration, use the op.drop_table function, run mypy.

Error

migrations/versions/954fd0bb09be_add_users_table.py:26: error: Missing positional argument "schema" in call to "drop_table"
        op.drop_table("users")
        ^

Versions.

  • Python: 3.8
  • Alembic: 1.7.0
  • SQLAlchemy: 1.4.17

Suggestion

Maybe add default values to Optional arguments in pyi files?

Have a nice day!

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

    bugSomething isn't workingpep 484typing related issues

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions