Skip to content

fix: add missing space in provider UserError messages#4976

Open
graydeon wants to merge 3 commits intopydantic:mainfrom
graydeon:fix/provider-error-message-spacing
Open

fix: add missing space in provider UserError messages#4976
graydeon wants to merge 3 commits intopydantic:mainfrom
graydeon:fix/provider-error-message-spacing

Conversation

@graydeon
Copy link
Copy Markdown

@graydeon graydeon commented Apr 4, 2026

All provider modules use implicit string concatenation for the "missing API key" UserError, but the first string literal doesn't end with a space. This produces malformed output:

Set the `GOOGLE_API_KEY` environment variable or pass it via `GoogleProvider(api_key=...)`to use the Google Generative Language API.

The fix adds a leading space to the second string literal across all 17 affected provider files.

Pre-Review Checklist

  • Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
  • No breaking changes in accordance with the version policy.
  • Linting and type checking pass per make format and make typecheck.
  • PR title is fit for the release changelog.

Pre-Merge Checklist

  • New tests for any fix or new behavior, maintaining 100% coverage.
  • Updated documentation for new features and behaviors, including docstrings for API docs.

All provider modules use implicit string concatenation for the
"missing API key" error message, but the first line doesn't end
with a space. This produces malformed output like:
  `GoogleProvider(api_key=...)`to use the Google...
instead of:
  `GoogleProvider(api_key=...)` to use the Google...

Closes pydantic#4975
@github-actions github-actions bot added size: S Small PR (≤100 weighted lines) bug Report that something isn't working, or PR implementing a fix labels Apr 4, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

graydeon added 2 commits April 3, 2026 21:34
These two providers already had a trailing space on the first string
literal, so the leading space added in the previous commit created a
double space. Revert to the original (no leading space) for these two.
The provider tests assert on the full error message string, so they
need the same spacing fix applied to the expected patterns.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Report that something isn't working, or PR implementing a fix size: S Small PR (≤100 weighted lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing space in UserError messages across provider modules

1 participant