Add test coverage for data_transformation.py and fix DeprecationWarning bug#274
Add test coverage for data_transformation.py and fix DeprecationWarning bug#274
Conversation
Co-authored-by: talgalili <976006+talgalili@users.noreply.github.com>
|
Fix Run flake8 . |
Co-authored-by: talgalili <976006+talgalili@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR improves test coverage for balance/utils/data_transformation.py from 98% to 99% by adding a test for the deprecation warning in auto_aggregate() and fixing a bug where warnings.DeprecationWarning was incorrectly used instead of the built-in DeprecationWarning class.
Changes:
- Fixed bug in
auto_aggregate()wherewarnings.DeprecationWarningshould beDeprecationWarning - Added test coverage for the
featuresparameter deprecation warning path inauto_aggregate()
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| balance/utils/data_transformation.py | Fixed incorrect warnings.DeprecationWarning to DeprecationWarning in the auto_aggregate() function's deprecation warning |
| tests/test_util_data_transformation.py | Added test_auto_aggregate_features_deprecation() to test the deprecation warning when the features parameter is used |
|
@copilot |
Co-authored-by: talgalili <976006+talgalili@users.noreply.github.com>
Added test in commit 3e0abbb. The test uses mocking to simulate the edge case where |
|
Fix Run ufmt check . |
Co-authored-by: talgalili <976006+talgalili@users.noreply.github.com>
|
@talgalili has imported this pull request. If you are a Meta employee, you can view this in D90921886. |
|
@talgalili merged this pull request in 2c0a324. |
quantize()TypeError when input is neither Series nor DataFrame (line 162) ✅auto_aggregate()DeprecationWarning when features parameter is not None (line 264) ✅auto_aggregate()wherewarnings.DeprecationWarningshould beDeprecationWarning✅Summary
test_auto_aggregate_features_deprecationcovers the deprecation warning path (line 264)test_quantize_non_dataframe_raisescovers the edge case error handling (line 162)warnings.DeprecationWarningtoDeprecationWarninginauto_aggregate()pd.Series()returns an object that is neither a Series nor a DataFrameOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.