Skip to content

fix: Lazy load integration modules - #795

Merged
Abhijeet Prasad (AbhiPrasad) merged 2 commits into
mainfrom
abhi-lazy-load-py
Sep 24, 2026
Merged

Abhijeet Prasad (AbhiPrasad) merged 2 commits into
mainfrom
abhi-lazy-load-py

Conversation

@AbhiPrasad

@AbhiPrasad Abhijeet Prasad (AbhiPrasad) commented Sep 22, 2026

Copy link
Copy Markdown
Member

resolves https://linear.app/braintrustdata/issue/SDK-327/lazy-load-python-sdk-integrations-on-import

  • Modules loaded: 639 → 493
  • Integration modules: 125 → 0
  • Median import time: 130 ms → 109 ms

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 22, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-24T14:54:55.701437Z f1a216c New commits
ℹ️ About Codex in GitHub

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

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: f1a216cd31

ℹ️ 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/auto.py

if openai:
results["openai"] = _instrument_integration(OpenAIIntegration)
results["openai"] = _instrument_integration("openai", "OpenAIIntegration")

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 Update the existing test double for the new helper signature

When test_auto_instrument_registration_and_disable runs in test_core, it monkeypatches braintrust.auto._instrument_integration with the one-argument function lambda _: False. This changed call supplies two arguments, so the first enabled OpenAI branch raises TypeError and aborts the test. Update that test double to accept the module and class names, or retain a one-argument helper interface, so the core suite remains green.

Useful? React with 👍 / 👎.

@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) merged commit 3d72b4a into main Sep 24, 2026
83 checks passed
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) deleted the abhi-lazy-load-py branch September 24, 2026 15:27
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.

2 participants