Skip to content

fix: resolve top-level resource classes in mypy - #710

Open
mrlonely (mameikagou) wants to merge 2 commits into
braintrustdata:mainfrom
mameikagou:codex/fix-top-level-resource-types
Open

fix: resolve top-level resource classes in mypy#710
mrlonely (mameikagou) wants to merge 2 commits into
braintrustdata:mainfrom
mameikagou:codex/fix-top-level-resource-types

Conversation

@mameikagou

Copy link
Copy Markdown

Fixes #498.

The package root wildcard-imported generated API TypedDicts with the same names as Experiment, Dataset, Project, and Prompt. Runtime imports selected the resource classes, but mypy selected the generated types.

This explicitly re-exports the non-conflicting generated types so the four resource names resolve consistently, while keeping every existing generated name available at the package root. A type regression test covers the public resource methods.

Validation:

  • uv run nox -s test_types
  • uv run nox -s pylint
  • pre-commit hooks on changed files

@mameikagou
mrlonely (mameikagou) marked this pull request as ready for review August 22, 2026 03:05

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

Copy link
Copy Markdown

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: 4b64b6728b

ℹ️ 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 (@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 (@codex) address that feedback".

Comment thread py/src/braintrust/__init__.py Outdated
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.

mypy cannot resolve Experiment.fetch() — TypedDict from generated_types shadows logger class

1 participant