Add placeholder API_KEY value with a guard check to both sample scripts - #10
Closed
monica-unstructured wants to merge 1 commit into
Closed
Add placeholder API_KEY value with a guard check to both sample scripts#10monica-unstructured wants to merge 1 commit into
monica-unstructured wants to merge 1 commit into
Conversation
Running either script without the user correctly setting the API_KEY variable fails with an authentication error. We added a check that displays a user-friendly message if the script detects the default placeholder value, "YOUR_API_KEY_HERE", instead of proceeding and failing with a confusing API error partway through. Matches the same change already applied to the embedded copies of these scripts in docs PR #1090 (commit 4ed81e1d). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
No issues found across 2 files
Shadow auto-approve: would not auto-approve. This PR does not meet the repository auto-approval settings.
Re-trigger cubic
3 tasks
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.
Closed: this PR's branch was renamed, which unexpectedly closed the PR. Superseded by PR #11, which carries the same commit and content on the renamed branch.
Summary
Follow-up to PR #9, which added
extract_quickstart.pyandpartition_quickstart.pywithAPI_KEY = ""as the placeholder.API_KEYfails with an authentication error partway through the run.API_KEY = "YOUR_API_KEY_HERE"and adds a guard check that exits immediately with a clear message if that placeholder (or an empty string) is still in place, instead of failing with a confusing API error later in the script.4ed81e1d).Test plan
python3 -m py_compileon both scripts401authentication error, matching the commit message's claim🤖 Generated with Claude Code