-
-
Notifications
You must be signed in to change notification settings - Fork 26
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: adjusted type hints for UUID
when uuid-utils
is not installed
#133
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Type: Refactoring
PR Summary: This pull request focuses on adjusting type hints and import logic for UUID handling within the advanced_alchemy project, specifically when the optional dependency uuid-utils
is not installed. It introduces conditional imports based on the presence of uuid-utils
and refines type annotations and checks throughout the affected modules to ensure compatibility and correct behavior regardless of whether uuid-utils
is available.
Decision: Comment
📝 Type: 'Refactoring' - not supported yet.
- Sourcery currently only approves 'Typo fix' PRs.
✅ Issue addressed: this change correctly addresses the issue or implements the desired feature.
No details provided.
✅ Small diff: the diff is small enough to approve with confidence.
No details provided.
General suggestions:
- Consider using
isinstance
for type checks instead of comparing the class name as a string. This approach is more robust and idiomatic in Python, providing better support for inheritance and readability. - When casting types, especially in the context of decoding values, ensure that the input data is of the expected format to avoid runtime errors. It might be beneficial to add explicit checks or try-except blocks to handle unexpected data formats gracefully.
- Review the use of type casting throughout the changes to ensure that they are necessary and correctly applied, particularly when dealing with external libraries or data that might not always conform to expected formats.
Thanks for using Sourcery. We offer it for free for open source projects and would be very grateful if you could help us grow. If you like it, would you consider sharing Sourcery on your favourite social media? ✨
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
types are fun 🙃
Quality Gate passedIssues Measures |
Documentation preview will be available shortly at https://jolt-org.github.io/advanced-alchemy-docs-preview/133 |
This PR addresses an issue with type hints when
uuid-utils
is not installed.