question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unexpected keyword argument

See original GitHub issue

Hello, With the latest release of mypy and the master branch of sqlalchemy-stubs, this code causes mypy to raise a “error: Unexpected keyword argument “name” for “User”” Is there smth I can do to avoid these errors ?

from sqlalchemy import CheckConstraint, Column, Integer, String
from sqlalchemy.ext.declarative import as_declarative

@as_declarative()
class Base:
    pass


class User(Base):
    __tablename__ = 'users'
    id = Column(Integer, primary_key=True)
    name = Column(String)


user = User(name="xx")

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
ilevkivskyicommented, Dec 10, 2018
@as_declarative
class Base:
    def __init__(self, *args, **kwargs) -> None: ...
0reactions
mehdigmiracommented, Dec 10, 2018

But then I have a ton of "“error: Unexpected keyword argument “name” for “User”” errors. It would require me an hour of “type: ignore” to silence them ^^. I guess The only way is to wait for #5 to be resolved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why am I getting this unexpected keyword argument TypeError?
I've googled "unexpected keyword argument", but I can never find a definition; only other stackoverflow articles. What is wrong with my code ...
Read more >
unexpected-keyword-arg / E1123 - Pylint 2.16.0-dev ...
Description: Used when a function call passes a keyword argument that doesn't correspond to one of the function's parameter names. ... Created by...
Read more >
Unexpected Keyword Argument in Python - Codeigo
This is a Python TyperError that occurs when we try to call a function with a keyword argument that is not expected by...
Read more >
Accepting arbitrary keyword arguments in Python
Let's make a function that accepts arbitrary keyword arguments. ... TypeError: say_things() got an unexpected keyword argument 'ducks' ...
Read more >
How to debug task "got an unexpected keyword argument"
Hello list,. I wondering if someone might have a bright idea how I can debug the following error, which get periodically in production....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found