Skip to content

Fix get_flow() with reinstantiate=True for flows without extensions - #1733

Open
JaySingh79 wants to merge 1 commit into
openml:mainfrom
JaySingh79:fix/1626-get-flow-reinstantiate
Open

Fix get_flow() with reinstantiate=True for flows without extensions#1733
JaySingh79 wants to merge 1 commit into
openml:mainfrom
JaySingh79:fix/1626-get-flow-reinstantiate

Conversation

@JaySingh79

Copy link
Copy Markdown

Metadata

Details

Problem:
Calling openml.flows.get_flow(1, reinstantiate=True) (or any flow without a registered extension, e.g., openml.evaluation.EuclideanDistance or weka.SMO) raised ValueError: No extension registered which can handle flow: 1 (...).

from openml.flows.functions import get_flow
flow = get_flow(1, reinstantiate=True)  # ValueError

Root cause:
get_flow() directly accessed flow.extension which calls get_extension_by_flow(..., raise_if_no_extension=True).

Solution:

  • Modify get_flow() in openml/flows/functions.py to check for extension availability via flow._extension and get_extension_by_flow(..., raise_if_no_extension=False)
  • If an extension exists, reinstantiate as before (including strict_version handling)
  • If no extension, log a WARNING via logging.getLogger(__name__) and return flow with model=None instead of raising
  • Update docstring to document new behavior and add examples

Testing:

Modify get_flow() to gracefully handle flows without registered
extensions when reinstantiate=True is passed. Log a warning instead
of raising ValueError when no extension is available. Return flow
with model=None when reinstantiation is not possible. Update docstring
to document new behavior. Add tests for OpenML-native flows.

Fixes openml#1626
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.

[BUG] Error: No extension registered which can handle flow when using 'get_flow()' with reinstantiate=True

1 participant