Skip to content

pynamodb_mypy plugin issue #20746

@cunla

Description

@cunla

Bug Report
Issue related to pynamodb_mypy:

Traceback (most recent call last):
  File "mypy/checkexpr.py", line 6103, in accept
  File "mypy/checkexpr.py", line 6138, in accept_maybe_cache
  File "mypy/nodes.py", line 2289, in accept
  File "mypy/checkexpr.py", line 508, in visit_call_expr
  File "mypy/checkexpr.py", line 645, in visit_call_expr_inner
  File "mypy/checkexpr.py", line 1496, in check_call_expr_with_callee_type
  File "mypy/checkexpr.py", line 1589, in check_call
  File "mypy/checkexpr.py", line 1832, in check_callable_call
  File "mypy/checkexpr.py", line 1270, in apply_function_plugin
  File "/Users/style/cfa/d20-functions/.venv/lib/python3.12/site-packages/pynamodb_mypy/plugin.py", line 150, in _get_function_hook__pynamodb_attribute__init__
    self._inspect_pynamodb_attribute_init(ctx)
  File "/Users/style/cfa/d20-functions/.venv/lib/python3.12/site-packages/pynamodb_mypy/plugin.py", line 207, in _inspect_pynamodb_attribute_init
    attr_type = get_descriptor_access_type(ctx.context, internal_api, attr_instance)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/style/cfa/d20-functions/.venv/lib/python3.12/site-packages/pynamodb_mypy/_private_api.py", line 20, in get_descriptor_access_type
    mypy.checkmember.MemberContext(
TypeError: 'msg' is an invalid keyword argument for __init__()

Your Environment

  • Mypy version used: 1.19.1
  • Mypy command-line flags: --show-traceback
  • Mypy configuration options from mypy.ini (and other config files):
[tool.mypy]
packages = ['app', "slack_app", ]
python_version = "3.12"
strict = true
plugins = ['pynamodb_mypy']
exclude = [
    '.*/site-packages/.*',
    'otp',
    '^app/test',
    '^slack_app/test',
]
  • Python version used: 3.12.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrongtopic-pluginsThe plugin API and ideas for new plugins

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions