Skip to content

Conventional dataset tag - #359

Open
PGijsbers wants to merge 3 commits into
mainfrom
conventional-dataset-tag
Open

Conventional dataset tag#359
PGijsbers wants to merge 3 commits into
mainfrom
conventional-dataset-tag

Conversation

@PGijsbers

Copy link
Copy Markdown
Contributor

Add a datasets/{identifiers}/tags endpoint

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 623b2fc1-5ab1-4ac5-bffb-e1d5c21f6890

📥 Commits

Reviewing files that changed from the base of the PR and between affb186 and 4b5914d.

📒 Files selected for processing (2)
  • src/routers/datasets.py
  • tests/routers/dataset_tag_test.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/routers/dataset_tag_test.py
  • src/routers/datasets.py

Walkthrough

Adds POST /datasets/{identifier}/tags with path-based dataset identification and embedded tag input. The deprecated POST /datasets/tag endpoint delegates to the new implementation while preserving its response format. Tests cover authorization, responses, direct calls, duplicate tags, and missing datasets. Documentation describes the deprecation, migration criteria, and API modernization.

Possibly related PRs

  • openml/server-api#322: Adds database-layer handling for the integrity and duplicate-key errors mapped by the new tagging endpoint.

Suggested labels: tests, documentation

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is too vague to clearly describe the actual change, even though it references dataset tagging. Rename it to mention the new dataset-scoped tags endpoint and the deprecation of POST /datasets/tag.
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description directly mentions the new dataset tags endpoint, which matches the pull request.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch conventional-dataset-tag

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.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

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:

  • Consider returning a more semantically appropriate status code (e.g., 204 No Content) from the new POST /datasets/{identifier}/tags endpoint instead of 200 with a null body, since no response payload is provided.
  • The deprecated tag_dataset handler now calls the new tag_dataset_new route function directly; it would be cleaner to extract the shared tagging logic into a separate helper/service function that both endpoints call to avoid coupling between router handlers.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider returning a more semantically appropriate status code (e.g., 204 No Content) from the new `POST /datasets/{identifier}/tags` endpoint instead of `200` with a `null` body, since no response payload is provided.
- The deprecated `tag_dataset` handler now calls the new `tag_dataset_new` route function directly; it would be cleaner to extract the shared tagging logic into a separate helper/service function that both endpoints call to avoid coupling between router handlers.

## Individual Comments

### Comment 1
<location path="docs/migration.md" line_range="136" />
<code_context>
+???+ warning "This endpoint is deprecated"
+
+    The new tag endpoint is `POST` `/datasets/{identifier}/tags`.
+    The dataset identifier is provided as part of the path, the tag is still provided in the body.
+    This endpoint is provided for easier migration in case the response matters to you.
+
</code_context>
<issue_to_address>
**issue (typo):** Fix the comma splice between the two independent clauses.

You can fix this by replacing the comma with "and", using a semicolon, or splitting it into two sentences.

```suggestion
    The dataset identifier is provided as part of the path and the tag is still provided in the body.
```
</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 thread docs/migration.md
@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.64%. Comparing base (a1367c0) to head (4b5914d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #359      +/-   ##
==========================================
- Coverage   94.65%   94.64%   -0.01%     
==========================================
  Files          77       77              
  Lines        3815     3827      +12     
  Branches      248      248              
==========================================
+ Hits         3611     3622      +11     
  Misses        137      137              
- Partials       67       68       +1     

☔ View full report in Codecov by Harness.
📢 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
docs/migration.md (1)

135-137: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Document the replacement request body explicitly.

The new endpoint requires an embedded payload such as {"tag": "foo"}; showing this example would prevent clients from carrying over the legacy data_id field during migration.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/migration.md` around lines 135 - 137, Update the migration documentation
describing the POST /datasets/{identifier}/tags endpoint to explicitly show the
replacement request body, using a payload example with the tag field such as
{"tag": "foo"} and omitting the legacy data_id field.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@docs/migration.md`:
- Around line 135-137: Update the migration documentation describing the POST
/datasets/{identifier}/tags endpoint to explicitly show the replacement request
body, using a payload example with the tag field such as {"tag": "foo"} and
omitting the legacy data_id field.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 412be693-b754-4414-adab-161cbc1fdad6

📥 Commits

Reviewing files that changed from the base of the PR and between a1367c0 and 68f603e.

📒 Files selected for processing (4)
  • docs/migration.md
  • docs/roadmap.md
  • src/routers/datasets.py
  • tests/routers/dataset_tag_test.py

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/routers/datasets.py`:
- Line 112: Update test_dataset_tag_new_json to expect HTTPStatus.NO_CONTENT for
the dataset tags endpoint and verify the response body is empty, removing the
response.json() assertion because a 204 response has no JSON payload.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a321a955-6235-48ba-8df3-c59bb324983b

📥 Commits

Reviewing files that changed from the base of the PR and between 68f603e and affb186.

📒 Files selected for processing (1)
  • src/routers/datasets.py

Comment thread src/routers/datasets.py
@PGijsbers
PGijsbers force-pushed the conventional-dataset-tag branch from affb186 to fc10705 Compare July 27, 2026 10:35
@PGijsbers
PGijsbers force-pushed the conventional-dataset-tag branch from fc10705 to 4b5914d Compare July 27, 2026 13:32
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.

1 participant