Skip to content

Conversation

@PGijsbers
Copy link
Contributor

The extra nesting provided a nickname of the subflow in the context of the parent flow.

Supersedes #222

The extra nesting provided a nickname of the subflow in the context
of the parent flow.
@coderabbitai
Copy link

coderabbitai bot commented Dec 22, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

The pull request introduces a new Subflow TypedDict with identifier and flow fields and updates the Flow public schema so subflows is list[Subflow] instead of a list of nested Flow objects. The router get_flow now constructs subflows as {"identifier": ..., "flow": ...} and tests plus migration helpers were adjusted to produce and normalize the nested subflow structure.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Revert change of removing subflow context' directly describes the main objective of the PR, which is to revert a prior change and restore the subflow context with the extra nesting that provides a nickname.
Description check ✅ Passed The description explains the purpose of the revert by noting that the extra nesting provides a nickname of the subflow in the context of the parent flow, which aligns with the changes across multiple files.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch revert-subflow-change

📜 Recent review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ac80151 and 0ebac7d.

📒 Files selected for processing (1)
  • src/routers/openml/flows.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/routers/openml/flows.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Sourcery review
  • GitHub Check: Migration with mutations
  • GitHub Check: Migration read-only

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Dec 22, 2025

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@f3eaea7). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/routers/openml/flows.py 33.33% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #225   +/-   ##
=======================================
  Coverage        ?   54.44%           
=======================================
  Files           ?       32           
  Lines           ?     1135           
  Branches        ?      100           
=======================================
  Hits            ?      618           
  Misses          ?      516           
  Partials        ?        1           

☔ 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

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • The Flow model references Subflow before it is defined; consider either moving Subflow above Flow or using a string-annotated type (e.g. subflows: list["Subflow"]) to avoid forward-reference issues with type checkers and Pydantic’s annotation evaluation.
  • In get_flow, you now build subflow dictionaries manually; consider constructing Subflow-typed structures (or a Pydantic model) consistently instead of raw dicts to reduce the risk of key/name mismatches across the router, schema, and tests.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `Flow` model references `Subflow` before it is defined; consider either moving `Subflow` above `Flow` or using a string-annotated type (e.g. `subflows: list["Subflow"]`) to avoid forward-reference issues with type checkers and Pydantic’s annotation evaluation.
- In `get_flow`, you now build subflow dictionaries manually; consider constructing `Subflow`-typed structures (or a Pydantic model) consistently instead of raw dicts to reduce the risk of key/name mismatches across the router, schema, and tests.

## Individual Comments

### Comment 1
<location> `tests/routers/openml/flows_test.py:224-233` </location>
<code_context>
+                "identifier": None,
</code_context>

<issue_to_address>
**suggestion (testing):** Add a test case that covers subflows with a non-None identifier

This test only exercises `identifier=None`, while the expectation now treats each subflow as an object with both `identifier` and a nested `flow`. Please add or extend a test to cover a subflow with a non-empty identifier so we verify it is returned correctly and not ignored or mis-serialized.

Suggested implementation:

```python
                "identifier": "weka.J48",

```

If you also want to explicitly keep coverage for `identifier=None`, you can either:
1. Duplicate this subflow entry and keep one with `"identifier": None` and another with a non-empty identifier, or
2. Add a separate test case that asserts the `identifier` is `None` for a different subflow in the response.

Those additional changes would need to align with the actual API response data your fixtures/mocks are producing.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +224 to +233
"identifier": None,
"flow": {
"id": 4,
"uploader": 16,
"name": "weka.J48",
"class_name": "weka.classifiers.trees.J48",
"version": 1,
"external_version": "Weka_3.9.0_11194",
"description": (
"Ross Quinlan (1993). C4.5: Programs for Machine Learning. "
Copy link

Choose a reason for hiding this comment

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

suggestion (testing): Add a test case that covers subflows with a non-None identifier

This test only exercises identifier=None, while the expectation now treats each subflow as an object with both identifier and a nested flow. Please add or extend a test to cover a subflow with a non-empty identifier so we verify it is returned correctly and not ignored or mis-serialized.

Suggested implementation:

                "identifier": "weka.J48",

If you also want to explicitly keep coverage for identifier=None, you can either:

  1. Duplicate this subflow entry and keep one with "identifier": None and another with a non-empty identifier, or
  2. Add a separate test case that asserts the identifier is None for a different subflow in the response.

Those additional changes would need to align with the actual API response data your fixtures/mocks are producing.

@PGijsbers PGijsbers merged commit 9cbc00d into main Dec 22, 2025
9 checks passed
@PGijsbers PGijsbers deleted the revert-subflow-change branch December 22, 2025 18:58
@PGijsbers PGijsbers mentioned this pull request Dec 22, 2025
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.

2 participants