Skip to content

[ENH] V1 -> V2 Migration - Flows (module)#1609

Open
Omswastik-11 wants to merge 306 commits intoopenml:mainfrom
Omswastik-11:flow-migration-stacked
Open

[ENH] V1 -> V2 Migration - Flows (module)#1609
Omswastik-11 wants to merge 306 commits intoopenml:mainfrom
Omswastik-11:flow-migration-stacked

Conversation

@Omswastik-11
Copy link
Copy Markdown
Contributor

@Omswastik-11 Omswastik-11 commented Jan 8, 2026

Fixes #1601

added a Create method in FlowAPI for publishing flow but not refactored with old publish . (Needs discussion on this)
Added tests using fake_methods so that we can test without local V2 server . I have tested the FlowsV2 methods (get and exists ) and delete and list were not implemented in V2 server so I skipped them .

@Omswastik-11 Omswastik-11 changed the title [ENH] V1 -> V2 Migration [ENH] V1 -> V2 Migration - Flows (module) Jan 8, 2026
@Omswastik-11 Omswastik-11 marked this pull request as ready for review January 8, 2026 15:09
@geetu040 geetu040 mentioned this pull request Jan 9, 2026
18 tasks
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 12, 2026

Codecov Report

❌ Patch coverage is 39.82301% with 68 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.57%. Comparing base (e653ef6) to head (18baa19).

Files with missing lines Patch % Lines
openml/_api/resources/flow.py 40.21% 55 Missing ⚠️
openml/flows/flow.py 26.66% 11 Missing ⚠️
openml/flows/functions.py 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1609      +/-   ##
==========================================
- Coverage   54.67%   54.57%   -0.11%     
==========================================
  Files          63       63              
  Lines        5108     5153      +45     
==========================================
+ Hits         2793     2812      +19     
- Misses       2315     2341      +26     

☔ 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.

Copy link
Copy Markdown
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.

Nicely done overall.

Comment thread openml/_api/resources/base.py Outdated
Comment thread openml/_api/resources/base/resources.py Outdated
Comment thread openml/_api/resources/flows.py Outdated
Comment thread openml/_api/resources/flow.py Outdated
Comment thread openml/flows/functions.py Outdated
Comment thread openml/flows/functions.py Outdated
Comment thread openml/flows/functions.py Outdated
Comment thread tests/test_flows/test_flow_functions.py
Comment thread tests/test_flows/test_flow_migration.py Outdated
Comment thread openml/_api/resources/flows.py Outdated
@Omswastik-11 Omswastik-11 force-pushed the flow-migration-stacked branch from 614411f to 36184e5 Compare January 14, 2026 14:56
@Omswastik-11 Omswastik-11 requested a review from geetu040 January 14, 2026 15:10
@Omswastik-11
Copy link
Copy Markdown
Contributor Author

Hi @geetu040 !! Can you review the pre-commit failure It was due to merge conflicts more specifically for tasks . Should I change it on my branch ?

@geetu040
Copy link
Copy Markdown
Collaborator

Hi @geetu040 !! Can you review the pre-commit failure It was due to merge conflicts more specifically for tasks . Should I change it on my branch ?

can you try again, sync your branch with mine? It should be fixed now.

@Omswastik-11
Copy link
Copy Markdown
Contributor Author

I think that due to conflicts it did not synced properly . I have to revert it manually

Copy link
Copy Markdown
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.

Nice overall, few changes needed. I'll look at the tests later when the implementation is final.

Comment thread openml/_api/resources/flows.py Outdated
Comment thread openml/flows/functions.py Outdated
Comment thread openml/flows/functions.py Outdated
@Omswastik-11 Omswastik-11 marked this pull request as draft January 27, 2026 07:30
@Omswastik-11 Omswastik-11 marked this pull request as ready for review January 27, 2026 15:13
Omswastik-11 and others added 3 commits January 28, 2026 12:51
…into flow-migration-stacked

# Conflicts:
#	openml/_api/resources/__init__.py
#	openml/_api/resources/base/__init__.py
#	openml/_api/runtime/core.py
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 12 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread openml/_api/resources/flow.py Outdated
Comment thread openml/flows/flow.py
Comment thread tests/test_flows/test_flow.py Outdated
Comment thread tests/test_flows/test_flow_functions.py Outdated
Comment thread tests/test_flows/test_flow_functions.py Outdated
Comment thread tests/test_api/test_flow.py
Comment thread openml/flows/flow.py
Comment thread tests/test_flows/test_flow_functions.py Outdated
Comment thread tests/test_flows/test_flow_functions.py Outdated
Comment thread tests/test_flows/test_flow_functions.py Outdated
Comment thread openml/flows/functions.py Outdated
Comment thread openml/flows/functions.py Outdated
Comment thread openml/flows/functions.py Outdated
Comment thread openml/flows/functions.py Outdated
Comment thread openml/flows/functions.py Outdated
Comment thread tests/test_flows/test_flow_functions.py Outdated
Comment thread tests/test_flows/test_flow_functions.py Outdated
Comment thread tests/test_flows/test_flow_functions.py Outdated
Comment thread tests/test_flows/test_flow_functions.py Outdated
Comment thread tests/test_flows/test_flow_functions.py
Comment thread openml/_api/resources/flow.py Outdated
Comment thread openml/flows/flow.py
Comment thread openml/flows/flow.py Outdated
Comment thread openml/flows/flow.py Outdated
Copilot AI review requested due to automatic review settings March 31, 2026 14:20
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

openml/flows/functions.py:67

  • get_flow’s docstring still describes the old per-flow XML cache (writing to cache_directory/flows/{flow_id}/flow.xml and raising OpenMLCacheException). The implementation now delegates to openml._backend.flow.get and uses HTTPClient caching, so the documented side effects/raised exceptions are no longer accurate; please update the docstring to match current behavior (and describe the new cache location/semantics if relevant).
    """Fetch an OpenMLFlow by its server-assigned ID.

    Queries the OpenML REST API for the flow metadata and returns an
    :class:`OpenMLFlow` instance. If the flow is already cached locally,
    the cached copy is returned. Optionally the flow can be re-instantiated
    into a concrete model instance using the registered extension.

    Parameters
    ----------
    flow_id : int
        The OpenML flow id.
    reinstantiate : bool, optional (default=False)
        If True, convert the flow description into a concrete model instance
        using the flow's extension (e.g., sklearn). If conversion fails and
        ``strict_version`` is True, an exception will be raised.
    strict_version : bool, optional (default=True)
        When ``reinstantiate`` is True, whether to enforce exact version
        requirements for the extension/model. If False, a new flow may
        be returned when versions differ.

    ignore_cache : bool, default=False
        Whether to ignore the cache. If ``true`` this will download and overwrite the flow xml
        even if the requested flow is already cached.

    Returns
    -------
    OpenMLFlow
        The flow object with metadata; ``model`` may be populated when
        ``reinstantiate=True``.

    Raises
    ------
    OpenMLCacheException
        When cached flow files are corrupted or cannot be read.
    OpenMLServerException
        When the REST API call fails.

    Side Effects
    ------------
    - Writes to ``openml.config.cache_directory/flows/{flow_id}/flow.xml``
      when the flow is downloaded from the server.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_api/test_flow.py
Comment thread tests/test_flows/test_flow.py Outdated
Comment thread tests/test_flows/test_flow.py Outdated
Comment thread tests/test_flows/test_flow_functions.py
Copilot AI review requested due to automatic review settings March 31, 2026 17:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

openml/flows/functions.py:59

  • The get_flow docstring still describes the legacy per-flow XML cache (openml.config.cache_directory/flows/{flow_id}/flow.xml) and lists OpenMLCacheException, but get_flow now delegates to openml._backend.flow.get(...) which uses the HTTP client cache instead. Please update the docstring (side effects + raises section) to match the new caching/error behavior.
    Queries the OpenML REST API for the flow metadata and returns an
    :class:`OpenMLFlow` instance. If the flow is already cached locally,
    the cached copy is returned. Optionally the flow can be re-instantiated
    into a concrete model instance using the registered extension.

    Parameters
    ----------
    flow_id : int
        The OpenML flow id.
    reinstantiate : bool, optional (default=False)
        If True, convert the flow description into a concrete model instance
        using the flow's extension (e.g., sklearn). If conversion fails and
        ``strict_version`` is True, an exception will be raised.
    strict_version : bool, optional (default=True)
        When ``reinstantiate`` is True, whether to enforce exact version
        requirements for the extension/model. If False, a new flow may
        be returned when versions differ.

    Returns
    -------
    OpenMLFlow
        The flow object with metadata; ``model`` may be populated when
        ``reinstantiate=True``.

    Raises
    ------
    OpenMLCacheException
        When cached flow files are corrupted or cannot be read.
    OpenMLServerException
        When the REST API call fails.

    Side Effects
    ------------
    - Writes to ``openml.config.cache_directory/flows/{flow_id}/flow.xml``
      when the flow is downloaded from the server.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread openml/_api/resources/flow.py
Comment thread tests/test_flows/test_flow.py Outdated
Comment thread tests/test_flows/test_flow.py
Comment thread tests/test_flows/test_flow.py Outdated
@Omswastik-11 Omswastik-11 requested a review from geetu040 March 31, 2026 17:55
@Omswastik-11
Copy link
Copy Markdown
Contributor Author

Omswastik-11 commented Apr 26, 2026

Hi @geetu040 . As per discussion in final mentoring meeting isn't it ready to merge ?

Copy link
Copy Markdown
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.

Hi @geetu040 . As per discussion in final mentoring meeting isn't it ready to merge ?

I think this should be ready to merge once the remaining review comments are addressed:

Most of these are related to the tests. Other than that, the implementation looks good to me and should be ready for merge once those points are resolved.

Co-authored-by: Armaghan Shakir <raoarmaghanshakir040@gmail.com>
Copilot AI review requested due to automatic review settings May 1, 2026 09:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Comments suppressed due to low confidence (1)

openml/flows/functions.py:60

  • get_flow's docstring still references the removed flows-specific filesystem cache (e.g. .../flows/{flow_id}/flow.xml) and OpenMLCacheException, but the implementation now delegates to openml._backend.flow.get() (HTTP client cache) and no longer raises that exception. Please update the docstring (Raises/Side Effects/Notes) to reflect the new caching behavior and actual exceptions.
    Queries the OpenML REST API for the flow metadata and returns an
    :class:`OpenMLFlow` instance. If the flow is already cached locally,
    the cached copy is returned. Optionally the flow can be re-instantiated
    into a concrete model instance using the registered extension.

    Parameters
    ----------
    flow_id : int
        The OpenML flow id.
    reinstantiate : bool, optional (default=False)
        If True, convert the flow description into a concrete model instance
        using the flow's extension (e.g., sklearn). If conversion fails and
        ``strict_version`` is True, an exception will be raised.
    strict_version : bool, optional (default=True)
        When ``reinstantiate`` is True, whether to enforce exact version
        requirements for the extension/model. If False, a new flow may
        be returned when versions differ.

    Returns
    -------
    OpenMLFlow
        The flow object with metadata; ``model`` may be populated when
        ``reinstantiate=True``.

    Raises
    ------
    OpenMLCacheException
        When cached flow files are corrupted or cannot be read.
    OpenMLServerException
        When the REST API call fails.

    Side Effects
    ------------
    - Writes to ``openml.config.cache_directory/flows/{flow_id}/flow.xml``
      when the flow is downloaded from the server.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread openml/_api/resources/flow.py
Comment thread tests/test_api/test_flow.py
Comment thread openml/flows/functions.py
Comment thread openml/flows/flow.py
Comment thread openml/flows/flow.py
Comment thread openml/_api/resources/flow.py
Signed-off-by: Omswastik-11 <omswastikpanda11@gmail.com>
Signed-off-by: Omswastik-11 <omswastikpanda11@gmail.com>
Copilot AI review requested due to automatic review settings May 1, 2026 12:45
Signed-off-by: Omswastik-11 <omswastikpanda11@gmail.com>
@Omswastik-11 Omswastik-11 requested a review from geetu040 May 1, 2026 13:00
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@Omswastik-11
Copy link
Copy Markdown
Contributor Author

Omswastik-11 commented May 2, 2026

I think Github is having some issues . The diff of this PR looks outdated
Hi @geetu040 !! Can you check the replies to reviews and the failing tests and let me know if any changes needed ?

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.

[ENH] V1 → V2 API Migration - flows

7 participants