Skip to content

TypeError: dict expected at most 1 argument, got 2 #69

Description

@Suika

Annotation in commit 0827ad1 causes the following error whenever the application is trying to start or upgrade:

/app # FLASK_APP=app flask db upgrade
Traceback (most recent call last):
  File "/usr/local/bin/flask", line 6, in <module>
    sys.exit(main())
             ~~~~^^
  File "/usr/local/lib/python3.13/site-packages/flask/cli.py", line 1050, in main
    cli.main()
    ~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/click/core.py", line 1552, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.13/site-packages/click/core.py", line 2026, in invoke
    cmd_name, cmd, args = self.resolve_command(ctx, args)
                          ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/click/core.py", line 2072, in resolve_command
    cmd = self.get_command(ctx, cmd_name)
  File "/usr/local/lib/python3.13/site-packages/flask/cli.py", line 578, in get_command
    app = info.load_app()
  File "/usr/local/lib/python3.13/site-packages/flask/cli.py", line 308, in load_app
    app = locate_app(import_name, name)
  File "/usr/local/lib/python3.13/site-packages/flask/cli.py", line 218, in locate_app
    __import__(module_name)
    ~~~~~~~~~~^^^^^^^^^^^^^
  File "/app/app/__init__.py", line 23, in <module>
    class Plan(db.Model):
    ...<18 lines>...
            }
  File "/app/app/__init__.py", line 34, in Plan
    __table_args__: ClassVar[dict(str, str)] = {"postgresql_partition_by": "HASH (id)"}
                             ~~~~^^^^^^^^^^
TypeError: dict expected at most 1 argument, got 2

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

      No branches or pull requests

      Issue actions