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

Fix JSON encoding/schema of pydantic v1 models #163

Merged
merged 1 commit into from
May 12, 2024
Merged

Conversation

alexmojaki
Copy link
Contributor

Closes #147

Tested manually by install pydantic v1 and running:

import pydantic


class Foo(pydantic.BaseModel):
    bar: int
    baz: str


import logfire

logfire.configure(console=logfire.ConsoleOptions(verbose=True))

logfire.info('hi', foo=Foo(bar=1, baz='a'))

Automatic testing will require actually installing pydantic v1 in CI which is challenging. The tests fail to start in various ways with v1 installed. Using pydantic.v1 with v2 installed doesn't reproduce the original problem.

@alexmojaki alexmojaki enabled auto-merge (squash) May 12, 2024 10:38
Copy link

codecov bot commented May 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@alexmojaki alexmojaki merged commit 6f67fa2 into main May 12, 2024
13 checks passed
@alexmojaki alexmojaki deleted the alex/pydantic-v1 branch May 12, 2024 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support pydantic v1
1 participant