Skip to content

Add placeholder API_KEY value with a guard check to both sample scripts - #10

Closed
monica-unstructured wants to merge 1 commit into
mainfrom
add-api-key-guard-check
Closed

Add placeholder API_KEY value with a guard check to both sample scripts#10
monica-unstructured wants to merge 1 commit into
mainfrom
add-api-key-guard-check

Conversation

@monica-unstructured

@monica-unstructured monica-unstructured commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

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.py and partition_quickstart.py with API_KEY = "" as the placeholder.

  • Running either script without the user correctly setting API_KEY fails with an authentication error partway through the run.
  • Replaces the empty-string placeholder with 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.
  • Matches the same change already applied to the embedded copies of these two scripts in docs PR #1090 (commit 4ed81e1d).

Test plan

  • python3 -m py_compile on both scripts
  • Ran both scripts with the placeholder key in place; confirmed each exits immediately with the guard message
  • Confirmed against the live API that an empty string and the literal placeholder string both produce a genuine 401 authentication error, matching the commit message's claim

🤖 Generated with Claude Code

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>

@cubic-dev-ai cubic-dev-ai 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.

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

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.

1 participant