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

Unexpected behavior for Partial=True #1293

Closed
jxnl opened this issue May 16, 2024 · 2 comments
Closed

Unexpected behavior for Partial=True #1293

jxnl opened this issue May 16, 2024 · 2 comments
Assignees

Comments

@jxnl
Copy link

jxnl commented May 16, 2024

Noticed that if the JSON is missing a ", it is not parsed correctly. I expect

import pydantic_core

print(
    pydantic_core.from_json(
        '{"name": "jaso',
        allow_partial=True,
    )
)
# > {}
# > Expected {'name': 'jaso'}


print(
    pydantic_core.from_json(
        '{"name": "jaso"}',
        allow_partial=True,
    )
)
# > {'name': 'jaso'}
@jakevollkommer
Copy link

I swear this worked in a previous version?

@samuelcolvin
Copy link
Member

The behavior here definitely hasn't changed.

Also this is a duplicate of pydantic/jiter#100.

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

4 participants