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: set as default type for factory only if model is defined (Sourcery refactored) #482

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Jan 13, 2024

Pull Request #479 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 set-as-default-factory-for-type branch, then run:

git fetch origin sourcery/set-as-default-factory-for-type
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot force-pushed the sourcery/set-as-default-factory-for-type branch from 8fa5e61 to b2ce6c0 Compare January 13, 2024 15:22
@sourcery-ai sourcery-ai bot requested review from a team as code owners January 13, 2024 15:22
@sourcery-ai sourcery-ai bot force-pushed the sourcery/set-as-default-factory-for-type branch from b2ce6c0 to 104dc83 Compare January 14, 2024 04:34
if len(generic_args) != 1:
return None

return generic_args[0]
return None if len(generic_args) != 1 else generic_args[0]
Copy link
Author

Choose a reason for hiding this comment

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

Function BaseFactory._infer_model_type refactored with the following changes:

Copy link

sonarcloud bot commented Jan 14, 2024

Copy link

Documentation preview will be available shortly at https://litestar-org.github.io/polyfactory-docs-preview/482

@guacs guacs closed this Jan 14, 2024
@guacs guacs deleted the sourcery/set-as-default-factory-for-type branch January 14, 2024 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant