Skip to content

deprecate: Dataset without name parameter#4862

Open
Kludex wants to merge 6 commits intomainfrom
claude/slack-session-BGsXu
Open

deprecate: Dataset without name parameter#4862
Kludex wants to merge 6 commits intomainfrom
claude/slack-session-BGsXu

Conversation

@Kludex
Copy link
Copy Markdown
Member

@Kludex Kludex commented Mar 26, 2026

  • Add deprecation warning when name parameter is omitted from Dataset
  • Update Dataset docstrings to indicate name will be required in future
  • When loading Dataset from file without name, use filename as default_name before calling constructor to avoid spurious warnings
  • Update all tests to provide explicit name parameter
  • Update documentation examples to include name parameter

- Add deprecation warning when `name` parameter is omitted from Dataset
- Update Dataset docstrings to indicate name will be required in future
- When loading Dataset from file without name, use filename as default_name
  before calling constructor to avoid spurious warnings
- Update all tests to provide explicit name parameter
- Update documentation examples to include name parameter

https://claude.ai/code/session_01AKfpBCFjTPWEJdKu5oLKKH
@github-actions github-actions bot added size: S Small PR (≤100 weighted lines) feature New feature request, or PR implementing a feature (enhancement) labels Mar 26, 2026
@Kludex Kludex requested a review from dmontagu March 26, 2026 10:18
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 26, 2026

Docs Preview

commit: 944d9df
Preview URL: https://4d100e7e-pydantic-ai-previews.pydantic.workers.dev

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4a7c58d422

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +254 to +260
if name is None:
warnings.warn(
'Omitting the `name` parameter is deprecated. '
'Please provide a name for your Dataset.',
DeprecationWarning,
stacklevel=2,
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Scope deprecation warning to avoid hard failures under -W error

Dataset.__init__ now unconditionally emits a DeprecationWarning whenever name is None, and this warning becomes an exception in environments that treat warnings as errors (including this repo’s pytest config with filterwarnings = ["error", ...]). That means existing unnamed-dataset code paths (for example current tests like tests/evals/test_report_evaluators.py) now fail at construction time instead of exercising behavior, so this change is effectively breaking rather than deprecating for strict-warning users. Consider limiting the warning to explicit end-user constructor calls or updating all remaining internal unnamed call sites in the same change.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

View 2 additional findings in Devin Review.

Open in Devin Review

Comment on lines +254 to +260
if name is None:
warnings.warn(
'Omitting the `name` parameter is deprecated. '
'Please provide a name for your Dataset.',
DeprecationWarning,
stacklevel=2,
)
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot Mar 26, 2026

Choose a reason for hiding this comment

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

🚩 Incomplete deprecation migration across docs

The PR updates name in a subset of doc files (quick-start, core-concepts, overview, report-evaluators), but dozens of other doc files still have Dataset(cases=...) without name — e.g., docs/evals/evaluators/llm-judge.md:384, docs/evals/how-to/concurrency.md:19, docs/evals/how-to/retry-strategies.md:33, docs/evals/how-to/metrics-attributes.md:121, docs/evals.md:150, pydantic_evals/README.md:47, and pydantic_evals/pydantic_evals/lifecycle.py:59 (docstring). The test_examples.py:132 filter 'ignore:Omitting the \name` parameter is deprecated'ensures tests pass, but perdocs/AGENTS.md` rule:714 ("Omit deprecated features from user-facing docs"), these remaining usages should ideally be updated in a follow-up to avoid teaching users the deprecated pattern.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@github-actions github-actions bot added size: M Medium PR (101-500 weighted lines) and removed size: S Small PR (≤100 weighted lines) labels Mar 27, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

Use a `UserWarning` subclass instead of `DeprecationWarning` so the
deprecation is visible by default at runtime, following the approach from
sethmlarson.dev/deprecations-via-warnings-dont-work-for-python-libraries.

Also pass `name` to `Dataset(...)` in test_report_evaluators to stop the
warning from being promoted to an error by pytest's
`filterwarnings = ["error"]` config.
@Kludex Kludex force-pushed the claude/slack-session-BGsXu branch from 7a6afc9 to 13c41b2 Compare March 27, 2026 11:12
@github-actions github-actions bot added size: S Small PR (≤100 weighted lines) and removed size: M Medium PR (101-500 weighted lines) labels Mar 27, 2026
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 0 new potential issues.

View 2 additional findings in Devin Review.

Open in Devin Review

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 0 new potential issues.

View 2 additional findings in Devin Review.

Open in Devin Review

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 0 new potential issues.

View 2 additional findings in Devin Review.

Open in Devin Review

…slim tests

The class-based `ignore::pydantic_evals.PydanticEvalsDeprecationWarning`
filter crashes xdist workers when pydantic_evals is not installed.
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 0 new potential issues.

View 2 additional findings in Devin Review.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature request, or PR implementing a feature (enhancement) size: S Small PR (≤100 weighted lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants