-
Notifications
You must be signed in to change notification settings - Fork 4
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
Makes meds-transform and polars requirements more flexible. #103
Conversation
WalkthroughThe changes made in the pull request focus on updating the dependency version constraints in the Changes
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.
LGTM
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 (2)
src/MEDS_tabular_automl/mapper.py (2)
166-168
: Consider using a more specific exception type.While using a generic
Exception
makes the error handling more flexible, it might mask specific issues that should be handled differently. Consider:
- Using a custom exception type (e.g.,
TransformationError
) to catch specific transformation-related errors- Or at minimum, documenting the expected exception types in the docstring
Example implementation:
class TransformationError(Exception): """Raised when a transformation function fails.""" pass # Then in the docstring: """ Raises: TransformationError: When a transformation function fails ValueError: When input validation fails """
Line range hint
1-400
: Consider enhancing robustness with context managers.The lock file and cache management could benefit from using context managers to ensure proper cleanup in all scenarios.
Example implementation:
from contextlib import contextmanager @contextmanager def transformation_lock(cache_directory: Path): """Context manager for handling transformation locks.""" st_time, lock_fp = register_lock(cache_directory) try: yield st_time finally: if lock_fp.exists(): lock_fp.unlink() # Usage in wrap function: with transformation_lock(cache_directory) as st_time: # transformation logic here pass
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
src/MEDS_tabular_automl/mapper.py
(1 hunks)
🔇 Additional comments (1)
src/MEDS_tabular_automl/mapper.py (1)
166-168
: Verify the impact of version updates on transformations.
The changes in pyproject.toml allowing more flexible versions of polars
and meds-transform
could affect the transformation behavior.
✅ Verification successful
Let me analyze the results and generate a final response.
No impact detected from version updates on transformations
The codebase's usage of polars is limited to standard DataFrame operations that are stable across versions:
- Basic DataFrame operations: select, filter, with_columns
- I/O operations: read/write parquet
- Type conversions and column manipulations
- No usage of experimental or recently added features
Additionally, there are no direct imports or usage of meds-transform found in the codebase, suggesting the version update won't affect the transformation behavior.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for potential breaking changes in polars and meds-transform versions
# Check for polars version changes that might affect DataFrame operations
rg -A 3 "import polars|from polars"
# Check for meds-transform usage that might be affected by version changes
rg -A 3 "from meds_transform|import meds_transform"
# Look for specific polars DataFrame operations that might have changed
ast-grep --pattern 'df.$$$'
Length of output: 8361
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #103 +/- ##
=======================================
Coverage 81.96% 81.96%
=======================================
Files 20 20
Lines 1253 1253
=======================================
Hits 1027 1027
Misses 226 226 ☔ View full report in Codecov by Sentry. |
Summary by CodeRabbit
polars
,meds
, andmeds-transforms
to allow for broader compatibility with newer versions.