Skip to content

Conversation

@EmanAbdelhaleem
Copy link
Contributor

@EmanAbdelhaleem EmanAbdelhaleem commented Jan 7, 2026

Depends on #1576
Related to #1575

Details

This PR implements Evaluations resource, and refactor its existing functions

Copy link
Collaborator

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like circular imports

@geetu040 geetu040 mentioned this pull request Jan 9, 2026
25 tasks
@EmanAbdelhaleem
Copy link
Contributor Author

@geetu040 We have circular imports here cuz of importing OpenMLEvaluation

Error message:

  File "D:\Work\ESoC\Developing\openML\openml-python\scripts\reproduce_issues.py", line 1, in <module>
    import openml
  File "D:\Work\ESoC\Developing\openML\openml-python\openml\__init__.py", line 21, in <module>
    from . import (
  File "D:\Work\ESoC\Developing\openML\openml-python\openml\evaluations\__init__.py", line 3, in <module>
    from .evaluation import OpenMLEvaluation
  File "D:\Work\ESoC\Developing\openML\openml-python\openml\evaluations\evaluation.py", line 7, in <module>
    import openml.runs
  File "D:\Work\ESoC\Developing\openML\openml-python\openml\runs\__init__.py", line 3, in <module>
    from .functions import (
  File "D:\Work\ESoC\Developing\openML\openml-python\openml\runs\functions.py", line 32, in <module>
    from openml.tasks import (
  File "D:\Work\ESoC\Developing\openML\openml-python\openml\tasks\__init__.py", line 3, in <module>
    from .functions import (
  File "D:\Work\ESoC\Developing\openML\openml-python\openml\tasks\functions.py", line 15, in <module>
    from openml._api import api_context
  File "D:\Work\ESoC\Developing\openML\openml-python\openml\_api\__init__.py", line 1, in <module>
    from openml._api.runtime.core import APIContext
  File "D:\Work\ESoC\Developing\openML\openml-python\openml\_api\runtime\core.py", line 10, in <module>
    from openml._api.resources import (
  File "D:\Work\ESoC\Developing\openML\openml-python\openml\_api\resources\__init__.py", line 2, in <module>
    from openml._api.resources.evaluations import EvaluationsV1, EvaluationsV2
  File "D:\Work\ESoC\Developing\openML\openml-python\openml\_api\resources\evaluations.py", line 8, in <module>        
    from openml.evaluations.evaluation import OpenMLEvaluation
ImportError: cannot import name 'OpenMLEvaluation' from partially initialized module 'openml.evaluations.evaluation' (most likely due to a circular import) (D:\Work\ESoC\Developing\openML\openml-python\openml\evaluations\evaluation.py)```

Copy link
Collaborator

@geetu040 geetu040 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the listing functionality with the suggested approach in #1575 (comment). And also sync this PR with my base PR.

@geetu040
Copy link
Collaborator

@geetu040 We have circular imports here cuz of importing OpenMLEvaluation

I don't really have an explanation for why this could be happening, can you try to sync with my branch and see if it persists and we can have a look, otherwise I am going to refactor the config part so it may automatically fix this.

@EmanAbdelhaleem
Copy link
Contributor Author

Please update the listing functionality with the suggested approach in #1575 (comment). And also sync this PR with my base PR.

Updated, please check

Copy link
Collaborator

@geetu040 geetu040 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, should be fine with few changes as suggested. And some comments are open for discussion.



def _list_evaluations( # noqa: C901
def _list_evaluations(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect you didn't completely remove this and replace with api_context.backend.evaluations.list in partial because of the circular import error? As discussed in the standup, I think the api_context.backend.evaluations.list should return OpenMLEvaluation object, so best comply with both v1/v2 interface.

@codecov-commenter
Copy link

codecov-commenter commented Jan 20, 2026

Codecov Report

❌ Patch coverage is 75.45788% with 67 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.67%. Comparing base (645ef01) to head (30f8b0e).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
openml/_api/resources/tasks.py 21.27% 37 Missing ⚠️
openml/_api/http/client.py 82.60% 12 Missing ⚠️
openml/_api/runtime/fallback.py 0.00% 6 Missing ⚠️
openml/_api/runtime/core.py 82.14% 5 Missing ⚠️
openml/_api/resources/evaluations.py 95.08% 3 Missing ⚠️
openml/_api/resources/datasets.py 77.77% 2 Missing ⚠️
openml/_api/__init__.py 75.00% 1 Missing ⚠️
openml/_api/config.py 96.87% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1606      +/-   ##
==========================================
+ Coverage   52.78%   53.67%   +0.89%     
==========================================
  Files          36       47      +11     
  Lines        4331     4559     +228     
==========================================
+ Hits         2286     2447     +161     
- Misses       2045     2112      +67     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants