Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False-positive SchemaError for keyword-only args: Non-default argument follows default argument #1260

Open
rsokl opened this issue Apr 2, 2024 · 0 comments
Assignees

Comments

@rsokl
Copy link

rsokl commented Apr 2, 2024

  • pydantic-2.6.4
  • pydantic-core-2.16.3

Defining

@pydantic.validate_call()
def foo(*, x: int = 1, y: str):
    print(x, y)

raises:

SchemaError: Error building "call" validator:
  SchemaError: Error building "arguments" validator:
  SchemaError: Non-default argument 'y' follows default argument

however, this should be tolerated as both x and y are keyword-only arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants