Skip to content

fix(integrations/hamilton): drop the stale extra argument to require_plugin - #905

Open
Anai-Guo wants to merge 1 commit into
apache:mainfrom
Anai-Guo:fix-hamilton-require-plugin-arity
Open

fix(integrations/hamilton): drop the stale extra argument to require_plugin#905
Anai-Guo wants to merge 1 commit into
apache:mainfrom
Anai-Guo:fix-hamilton-require-plugin-arity

Conversation

@Anai-Guo

Copy link
Copy Markdown

Problem

burr.integrations.base.require_plugin takes two parameters:

def require_plugin(import_error: ImportError, plugin_name: str):

burr/integrations/hamilton.py passes three:

try:
    from hamilton.driver import Driver
except ImportError as e:
    require_plugin(
        e,
        ["sf-hamilton"],   # <-- stale, from an older signature
        "hamilton",
    )

So importing burr.integrations.hamilton without sf-hamilton installed raises

TypeError: require_plugin() takes 2 positional arguments but 3 were given

instead of the actionable message the helper exists to produce. The failure hits
exactly the users the helper is meant to help — the ones who have not installed
the extra.

Sibling baseline

Every one of the other eleven call sites passes (e, "<extras-target>"):

File Call
burr/cli/__main__.py:44 require_plugin(e, "start")
burr/integrations/bedrock.py:65 require_plugin(e, "bedrock")
burr/integrations/langfuse.py:34 require_plugin(e, "langfuse")
burr/integrations/opentelemetry.py:40 require_plugin(e, "opentelemetry")
burr/integrations/streamlit.py:34 require_plugin(e, "streamlit")
burr/integrations/persisters/b_asyncpg.py:30 base.require_plugin(e, "asyncpg")
burr/integrations/persisters/b_psycopg2.py:23 base.require_plugin(e, "postgresql")
burr/integrations/persisters/b_redis.py:25 base.require_plugin(e, "redis")
burr/integrations/persisters/postgresql.py:26 base.require_plugin(e, "postgresql")
burr/tracking/client.py:92 require_plugin(e, "tracking-client")
burr/tracking/common/models.py:30 require_plugin(e, "tracking")
burr/tracking/s3client.py:58 require_plugin(e, "tracking-s3")

hamilton.py is the only one out of step. "hamilton" is already the correct
value: pyproject.toml defines hamilton = ["sf-hamilton"] as an extras target,
so the message resolves to burr[hamilton], which is a real install command.

Fix

Drop the stale ["sf-hamilton"] argument — one line.

Verification

Executing the real burr/integrations/base.py and replaying both call shapes:

=== current hamilton.py call: require_plugin(e, ["sf-hamilton"], "hamilton") ===
  TypeError: require_plugin() takes 2 positional arguments but 3 were given

=== sibling baseline, e.g. langfuse.py: require_plugin(e, "langfuse") ===
  ImportError: Missing plugin langfuse! To use the langfuse plugin, you must
  install the 'extras' target [langfuse] with burr[langfuse] ...

=== after this patch: require_plugin(e, "hamilton") ===
  ImportError: Missing plugin hamilton! To use the hamilton plugin, you must
  install the 'extras' target [hamilton] with burr[hamilton] ...

🤖 Generated with Claude Code

…plugin

require_plugin(import_error, plugin_name) takes two arguments. The hamilton
integration passes three, so when sf-hamilton is not installed the ImportError
handler raises

    TypeError: require_plugin() takes 2 positional arguments but 3 were given

instead of the actionable "install burr[hamilton]" message the helper exists to
produce. The other eleven call sites all pass (e, "<extras-target>"); the extra
["sf-hamilton"] here is a leftover from an older signature.
@github-actions github-actions Bot added the area/integrations External integrations (LLMs, frameworks) label Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/integrations External integrations (LLMs, frameworks)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant