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

test: fix pydantic@v2 deprecation warning in tests (Sourcery refactored) #2341

Closed

Conversation

sourcery-ai[bot]
Copy link
Contributor

@sourcery-ai sourcery-ai bot commented Sep 23, 2023

Pull Request #2340 refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

NOTE: As code is pushed to the original Pull Request, Sourcery will
re-run and update (force-push) this Pull Request with new refactorings as
necessary. If Sourcery finds no refactorings at any point, this Pull Request
will be closed automatically.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the fix-pydantic-warning branch, then run:

git fetch origin sourcery/fix-pydantic-warning
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested review from a team as code owners September 23, 2023 09:01
@sourcery-ai sourcery-ai bot added the build-ignore This issue should skip builds label Sep 23, 2023
Comment on lines -267 to 277
if pydantic.VERSION.startswith("1"):

class Model(BaseModel):
value: str = Field(title="title", description="description", example="example", max_length=16)

else:
class Model(BaseModel):
if pydantic.VERSION.startswith("1"):
value: str = Field(title="title", description="description", example="example", max_length=16)

class Model(BaseModel):
else:
value: str = Field(
title="title", description="description", max_length=16, json_schema_extra={"example": "example"}
)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function test_create_schema_for_pydantic_field refactored with the following changes:

@sourcery-ai sourcery-ai bot closed this Sep 23, 2023
@sourcery-ai sourcery-ai bot deleted the sourcery/fix-pydantic-warning branch September 23, 2023 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-ignore This issue should skip builds
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants