Conversation
The client has read BRIGHTDATA_API_KEY as a fallback since 2.5.0 (TOKEN_ENV_VAR_ALT), but the missing-token error and the README only named BRIGHTDATA_API_TOKEN. BRIGHTDATA_API_KEY is the variable the Bright Data CLI reads and the one the docs use, so a user who set it for the CLI was told to set a different variable. - ValidationError lists BRIGHTDATA_API_KEY first, then BRIGHTDATA_API_TOKEN - README configuration example exports BRIGHTDATA_API_KEY and notes that BRIGHTDATA_API_TOKEN also works and wins when both are set - test_no_credentials_error_is_actionable also asserts BRIGHTDATA_API_KEY
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Since 2.5.0 the client reads
BRIGHTDATA_API_KEYas a fallback (TOKEN_ENV_VAR_ALT, covered bytest_alt_env_var), but the missing-token error and the README only nameBRIGHTDATA_API_TOKEN.BRIGHTDATA_API_KEYis the variable the Bright Data CLI reads and the one docs.brightdata.com now uses in its samples. A user who exported it for the CLI and then hit the SDK error was told to set a different variable.What changed
ValidationErrorfor a missing token listsBRIGHTDATA_API_KEY(noting the CLI reads it too), thenBRIGHTDATA_API_TOKEN.BRIGHTDATA_API_KEY, and notes thatBRIGHTDATA_API_TOKENalso works and wins when both are set.test_no_credentials_error_is_actionablealso assertsBRIGHTDATA_API_KEYis in the message.Lookup order is unchanged:
tokenargument,BRIGHTDATA_API_TOKEN,BRIGHTDATA_API_KEY, then the CLI's stored credentials.New error text:
Testing
pytest tests/unit: 335 passedruff check src tests: all checks passedblack --check src tests: no changes