-
Notifications
You must be signed in to change notification settings - Fork 559
Update evidently integration to support NumPy 2.0 #4243
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
Update evidently integration to support NumPy 2.0 #4243
Conversation
Updated the evidently integration to version >=0.5.0, which supports NumPy 2.0. This resolves the compatibility issue where users could not install packages requiring NumPy 2.0+ alongside ZenML's evidently integration. Changes: - Updated evidently version constraint from ">=0.4.16,<=0.4.22" to ">=0.5.0" - Removed the "numpy<2.0.0" constraint that was blocking NumPy 2.0 - Updated all imports to use evidently.legacy.* API for backward compatibility - Modified imports in __init__.py, data_validators, metrics.py, and tests.py - Updated docstring examples to reflect the new import paths The evidently 0.7+ versions introduced breaking API changes, but by using the evidently.legacy.* compatibility layer, we maintain full backward compatibility with existing ZenML code while gaining NumPy 2.0 support. Fixes #4242
Documentation Link Check Results❌ Absolute links check failed |
|
@claude fix the linting problems https://github.com/zenml-io/zenml/actions/runs/19629219988/job/56204745370?pr=4243 |
|
Claude finished @htahir1's task —— View job Fixing Linting Issues ✅I've successfully fixed the linting problem in the evidently integration. Tasks:
What was fixed: # Before (with backslash)
return cls.REQUIREMENTS + \
PandasIntegration.get_requirements(target_os=target_os, python_version=python_version)
# After (with implicit continuation)
return cls.REQUIREMENTS + PandasIntegration.get_requirements(
target_os=target_os, python_version=python_version
)The fix has been committed and pushed to the branch. The CI should pass now when it re-runs the linting checks. --- | Branch: claude/zenml-issue-4221-01XfiHWRp7mJ7B5suAJstuGT | Commit: b8f3694 |
Co-authored-by: Hamza Tahir <[email protected]>
|
@claude /full-review |
|
Claude finished @strickvl's task —— View job Full Review of Evidently NumPy 2.0 UpdatePerforming comprehensive review of PR #4243... Tasks:
SummaryThis PR successfully updates the Evidently integration from version ✅ Strengths
🔴 Critical IssuesNone identified. 🟡 Issues & Suggestions1. Missing categorical_features mapping in column_mapping.py (src/zenml/integrations/evidently/column_mapping.py:95)The def to_evidently_column_mapping(self) -> ColumnMapping:
column_mapping = ColumnMapping()
# ... other assignments ...
column_mapping.numerical_features = (
self.numerical_features or column_mapping.numerical_features
)
column_mapping.datetime_features = (
self.datetime_features or column_mapping.datetime_features
)
# Missing: column_mapping.categorical_features assignment!Recommendation: Add the missing assignment: column_mapping.categorical_features = (
self.categorical_features or column_mapping.categorical_features
)Note: This appears to be a pre-existing bug not introduced by this PR, but it should be fixed. 2. Consider adding version constraint upper bound (src/zenml/integrations/evidently/init.py:57)The current constraint is Recommendation: Consider constraining to 3. Documentation example inconsistency (docs/book/component-guide/data-validators/evidently.md:603)Line 603 has a subtle bug in the example code - it creates a test_suite = TestSuite(metrics=[test_preset.DataQualityTestPreset()])
report.run( # Should be test_suite.run()Recommendation: Fix to Note: This is a pre-existing documentation bug not introduced by this PR. 4. Import style inconsistency in documentation (docs/book/component-guide/data-validators/evidently.md)Some documentation examples show imports like: from evidently.legacy.report import Report
from evidently.legacy import metric_presetWhile others show: from evidently.legacy.metrics import ColumnRegExpMetric
from evidently.legacy.metric_preset import DataQualityPresetRecommendation: Consider standardizing on one import style throughout the documentation for better readability. The second style (explicit class imports) is generally clearer. 5. Missing type ignore comments justification (multiple files)Several imports have Recommendation: Consider adding a comment explaining why type ignores are necessary and whether this is expected to change in future Evidently versions. 🟢 Minor Observations
Verification ChecklistBased on the CLAUDE.md guidelines:
Recommendations
Overall AssessmentThis is a solid, well-executed migration that achieves its goal of enabling NumPy 2.0 support. The use of the legacy API is appropriate and maintains backward compatibility. The main concerns are minor issues and pre-existing bugs that should be addressed in follow-up work. The PR is ready to merge after verification that integration tests pass. Recommendation: ✅ APPROVE (after confirming tests pass) |
|
@claude implement Consider adding version constraint upper bound (src/zenml/integrations/evidently/init.py:57), Documentation example inconsistency (docs/book/component-guide/data-validators/evidently.md:603), and Import style inconsistency in documentation (docs/book/component-guide/data-validators/evidently.md) |
|
Claude finished @htahir1's task —— View job Implementing Review Suggestions ✅Successfully implemented all requested changes from the review. Tasks:
Changes made:
All changes have been committed and pushed to the branch. View job | Branch: claude/zenml-issue-4221-01XfiHWRp7mJ7B5suAJstuGT | Commit: 187d7af |
- Add upper bound to evidently version constraint (>=0.5.0,<1.0) to prevent unexpected breakage from future major versions - Fix documentation bug where test_suite.run() was incorrectly called as report.run() - Fix TestSuite using incorrect parameter name (metrics instead of tests) - Standardize import style to use explicit class imports for better clarity 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Hamza Tahir <[email protected]>
ZenML CLI Performance Comparison (Threshold: 1.0s, Timeout: 60s, Slow: 5s)❌ Failed Commands on Current Branch (claude/zenml-issue-4221-01XfiHWRp7mJ7B5suAJstuGT)
🚨 New Failures IntroducedThe following commands fail on your branch but worked on the target branch:
Performance Comparison
Summary
Environment Info
|
| parameters=dict( | ||
| report_options = [ | ||
| ( | ||
| "evidently.options.ColorOptions", { |
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.
Possibly set this to the .legacy import otherwise maybe it's a bit confusing?
strickvl
left a comment
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.
Some small nits, mostly about standardising how we refer to things, though it should be backwards compatible.
| parameters=dict( | ||
| test_options = [ | ||
| ( | ||
| "evidently.options.ColorOptions", { |
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.
Same here: possibly set this to the .legacy import otherwise maybe it's a bit confusing?
| # Configure an Evidently Metric generator using a full Metric class | ||
| # path | ||
| config = EvidentlyMetric.metric_generator( | ||
| "evidently.metrics.ColumnSummaryMetric", columns=["age", "name"] |
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.
| "evidently.legacy.metrics.ColumnSummaryMetric", columns=["age", "name"] |
I think?
| # Configure an Evidently MetricPreset using its full class path | ||
| config = EvidentlyMetric.metric( | ||
| "evidently.metric_preset.DataDriftPreset" |
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.
| "evidently.legacy.metric_preset.DataDriftPreset" |
| # Configure an Evidently Test generator using a full Test class | ||
| # path | ||
| config = EvidentlyTest.test_generator( | ||
| "evidently.tests.TestColumnShareOfMissingValues", columns=["age", "name"] |
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.
| "evidently.legacy.tests.TestColumnShareOfMissingValues", columns=["age", "name"] |
I think? Feels less confusing this way, even though both should be handled?
| There are several ways you can reference the Evidently tests when configuring `EvidentlyTestConfig` items, similar to how you reference them in an `EvidentlyMetricConfig` object: | ||
|
|
||
| * by class name: this is the easiest way to reference an Evidently test. You can use the name of a test or test preset class as it appears in the Evidently documentation (e.g.`"DataQualityTestPreset"`, `"TestColumnRegExp"`). | ||
| * by full class path: you can also use the full Python class path of the test or test preset class ( e.g. `"evidently.test_preset.DataQualityTestPreset"`, `"evidently.tests.TestColumnRegExp"`). This is useful if you want to use tests or test presets that are not included in Evidently library. |
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.
| * by full class path: you can also use the full Python class path of the test or test preset class ( e.g. `"evidently.test_preset.DataQualityTestPreset"`, `"evidently.legacy.tests.TestColumnRegExp"`). This is useful if you want to use tests or test presets that are not included in Evidently library. |
Same here I think?

Updated the evidently integration to version >=0.5.0, which supports NumPy 2.0. This resolves the compatibility issue where users could not install packages requiring NumPy 2.0+ alongside ZenML's evidently integration.
Changes:
The evidently 0.7+ versions introduced breaking API changes, but by using the evidently.legacy.* compatibility layer, we maintain full backward compatibility with existing ZenML code while gaining NumPy 2.0 support.
Fixes #4242
Describe changes
I implemented/fixed _ to achieve _.
Pre-requisites
Please ensure you have done the following:
developand the open PR is targetingdevelop. If your branch wasn't based on develop read Contribution guide on rebasing branch to develop.Types of changes