Skip to content

Conversation

@mewwts
Copy link
Member

@mewwts mewwts commented Sep 26, 2025

This PR deprecated from_env() in favor of just using the DuneClient() constructor

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Comment @cursor review or bugbot run to trigger another review on this PR

# Read from environment variables if not provided
api_key = api_key or os.environ["DUNE_API_KEY"]
base_url = base_url or os.environ.get("DUNE_API_BASE_URL", "https://api.dune.com")
request_timeout = request_timeout or float(os.environ.get("DUNE_API_REQUEST_TIMEOUT", "10"))
Copy link

Choose a reason for hiding this comment

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

Bug: Constructor Fails to Respect Falsy Parameter Values

The BaseDuneClient constructor's use of the or operator for parameter fallback incorrectly overrides explicitly passed falsy values. This means api_key="", base_url="", or request_timeout=0.0 are ignored, falling back to environment variables or defaults instead of using the provided value.

Fix in Cursor Fix in Web

Copy link
Contributor

@bh2smith bh2smith left a comment

Choose a reason for hiding this comment

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

Seems legit.

@mewwts mewwts merged commit 2b25e9e into main Sep 26, 2025
3 checks passed
@mewwts mewwts deleted the deprecate-from-env branch September 26, 2025 10:03
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.

3 participants