Skip to content

[BREAKING] FIX Reject empty dataset filter criteria - #2951

Open
Jaafer Rahmani (bIackr0se) wants to merge 3 commits into
microsoft:mainfrom
bIackr0se:fix/reject-empty-dataset-criteria
Open

Jaafer Rahmani (bIackr0se) wants to merge 3 commits into
microsoft:mainfrom
bIackr0se:fix/reject-empty-dataset-criteria

Conversation

@bIackr0se

Copy link
Copy Markdown
Contributor

Description

SeedDatasetFilter(criteria=[]) accepts an empty OR-list, so catalog matching silently returns no datasets. Raise ValueError at construction and tell callers to omit criteria for an unconstrained filter.

This changes the explicit empty-list case from an empty result to an exception. Non-empty criteria, flat filter arguments and omitted criteria retain their behavior.

Built-in catalog discovery:

Filter Before After
criteria=[] 0 names ValueError
SeedDatasetFilter() 122 names Same 122 names
criteria=[SeedDatasetMetadata()] 122 names Same 122 names

Fixes #2947.

Tests and Documentation

  • Both empty-list regressions fail on upstream with DID NOT RAISE; conflicting-arguments and unconstrained-filter controls pass.
  • Metadata and provider tests: 225 passed.
  • Dataset unit tests (make unit-test, running pytest -n 4 --dist=loadfile tests/unit/datasets): 4,946 passed.
  • Full ty check pyrit, changed-file Ruff and formatting, and applicable source hooks passed.
  • Class and constructor documentation specify a non-empty criteria list.

@romanlutz Roman Lutz (romanlutz) self-assigned this Oct 9, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@romanlutz Roman Lutz (romanlutz) changed the title [DRAFT] [BREAKING] FIX Reject empty dataset filter criteria [BREAKING] FIX Reject empty dataset filter criteria Oct 10, 2026
@romanlutz
Roman Lutz (romanlutz) marked this pull request as ready for review October 10, 2026 05:14
Keep a single empty-criteria guard in _validate while retaining the actionable error and regression coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Oct 10, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 10, 2026
@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Oct 10, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 10, 2026

This branch has not been deployed

No deployments
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.

SeedDatasetFilter(criteria=[]) silently matches no datasets

2 participants