Skip to content

docs: add code sample snippets for welcome page documentation#17744

Closed
shuoweil wants to merge 7 commits into
mainfrom
shuowei-add-bf-example
Closed

docs: add code sample snippets for welcome page documentation#17744
shuoweil wants to merge 7 commits into
mainfrom
shuowei-add-bf-example

Conversation

@shuoweil

@shuoweil shuoweil commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Adds sample code snippets with region tags (# [START ...] / # [END ...]) for BigQuery DataFrames documentation welcome page (python-libraries.md).

Note here, we need to place all imports inside testcase functions for the following reasons:

  1. Doc Ingestion Boundaries: Documentation generation tools only extract code between # [START] and # [END] tags. Any top-of-file imports get stripped out.
  2. Copy-Paste Runnable: Placing imports inside the function ensures the rendered code snippet on cloud.google.com includes the import statements, allowing users to copy and run it without hitting a NameError.

Fixes #<522845525> 🦕

@shuoweil shuoweil self-assigned this Jul 16, 2026
@shuoweil
shuoweil requested review from a team as code owners July 16, 2026 19:03
@snippet-bot

snippet-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

No region tags are edited in this PR.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@shuoweil
shuoweil marked this pull request as draft July 16, 2026 19:04
@shuoweil
shuoweil force-pushed the shuowei-add-bf-example branch from 437d834 to 88e57cd Compare July 16, 2026 19:06
@shuoweil
shuoweil marked this pull request as ready for review July 16, 2026 19:08

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds a new test file, packages/bigframes/samples/snippets/samples_test.py, which includes several test cases for BigQuery BigFrames snippets. The reviewer identified that these tests will fail in CI environments due to the use of placeholder project IDs and table names, and provided actionable feedback to mock the API calls using unittest.mock to ensure the tests are runnable.

Comment thread packages/bigframes/samples/snippets/samples_test.py Outdated
Comment thread packages/bigframes/samples/snippets/samples_test.py Outdated
@shuoweil shuoweil added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 16, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 16, 2026
@shuoweil
shuoweil force-pushed the shuowei-add-bf-example branch from 2a0b12a to 6558872 Compare July 16, 2026 22:03
@shuoweil shuoweil closed this Jul 16, 2026
@shuoweil shuoweil reopened this Jul 16, 2026
@shuoweil shuoweil closed this Jul 16, 2026
@shuoweil

Copy link
Copy Markdown
Contributor Author

Add the code sample using another branch: GoogleCloudPlatform/python-docs-samples#14429

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.

2 participants