-
Notifications
You must be signed in to change notification settings - Fork 82
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
Fixed floating point data type check in knowledge vault #1634
Conversation
WalkthroughThe changes in this pull request focus on the Changes
Possibly related PRs
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
kairon/shared/cognition/processor.py (1)
393-399
: Improve error handling in float validation.The float validation logic is good, but the error handling can be improved by preserving the original exception context.
Consider this improvement:
if data_type == CognitionMetadataType.float.value: try: - return float(value) + float(value) # validate type except (ValueError, TypeError) as err: raise AppException( f"Invalid data type for '{column_name}': Expected float value" - ) + ) from err🧰 Tools
🪛 Ruff (0.8.0)
397-399: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
kairon/shared/cognition/processor.py
(1 hunks)tests/unit_test/data_processor/data_processor2_test.py
(1 hunks)
🧰 Additional context used
🪛 Ruff (0.8.0)
kairon/shared/cognition/processor.py
397-399: Within an except
clause, raise exceptions with raise ... from err
or raise ... from None
to distinguish them from errors in exception handling
(B904)
🔇 Additional comments (2)
tests/unit_test/data_processor/data_processor2_test.py (2)
117-117
: LGTM!
The test data update maintains consistency with the test's purpose.
124-138
: LGTM! Well-structured test case.
The new test case effectively validates that integer values are accepted in float fields, following the existing test patterns and maintaining good test coverage.
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.
reviewed
Summary by CodeRabbit
New Features
Bug Fixes
Tests