[MNT] Add Missing Assertions to Run Function Tests - #1658
Akarshkushwaha wants to merge 4 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1658 +/- ##
==========================================
- Coverage 81.50% 80.69% -0.81%
==========================================
Files 63 63
Lines 5238 5238
==========================================
- Hits 4269 4227 -42
- Misses 969 1011 +42 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
AtharvaManale
left a comment
There was a problem hiding this comment.
Just cross check the reviews started beside the specific changes in the tests/test_runs/test_run_functions.py
| # TODO: assert holdout task | ||
| if create_task_obj: | ||
| task = openml.tasks.get_task(run.task_id) | ||
| assert task.task_type_id == TaskType.SUPERVISED_CLASSIFICATION or task.task_type_id == TaskType.SUPERVISED_REGRESSION |
There was a problem hiding this comment.
Holdout task isn't specific for SUPERVISED_CLASSIFICATION tasks, it is an estimation_procedure type.
For ex:
task.estimation_procedure = { "type": "holdout", "parameters": { "number_repeats": "1", "number_folds": "", "percentage": "33", "stratified_sampling": "true" }, "data_splits_url": "https://test.openml.org/..." } as seen in openml/tasks/task.py.
so you have to check about type of estimation procedure rather than task type.
|
I am getting some unexpected responses from seemingly sane assertions, such as checking |
|
@PGijsbers , @Akarshkushwaha, I would like to suggest some changesas follows: As holdout set/task is type of an estimation_procedure of an task so we should validate that. As for a legal race_iteration exactly one of As for comparing the downloaded_run_trace with existing run.trace to check whether downloaded run carries the trace as objects. All changes are for tests/test_runs/test_run_functions.py |
Metadata
Details
What does this PR implement/fix? Explain your changes.
This PR adds missing assertions to [tests/test_runs/test_run_functions.py] where
TODOcomments indicated gaps in verification.Specific changes:
task.task_type_idmatches supervised classification or regression.run.run_idandrun.flow_idare set correctly. Note:run.uploaderis skipped as it's not populated on the local object immediately after publish.run.traceproperties (id match, non-empty iterations).downloaded.uploader,downloaded.task_id, anddownloaded.flow_idto ensure integrity of the fetched run.run.output_files["predictions"] is not None.Why is this change necessary? What is the problem it solves?
The tests contained several
TODOplaceholders for missing validations. These assertions make the test suite more robust by verifying that runs are correctly constructed, uploaded, and retrievable with expected properties.How can I reproduce the issue this PR is solving and its solution?
Run the updated tests: