Skip to content

Tswast magics blog#17216

Draft
tswast wants to merge 3 commits into
mainfrom
tswast-magics-blog
Draft

Tswast magics blog#17216
tswast wants to merge 3 commits into
mainfrom
tswast-magics-blog

Conversation

@tswast
Copy link
Copy Markdown
Contributor

@tswast tswast commented May 20, 2026

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

Copy link
Copy Markdown
Contributor

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

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 introduces a new Jupyter notebook tutorial demonstrating how to query local Excel files using BigQuery DataFrames. The reviewer identified several critical issues: the notebook contains significant redundancy and redundant implementation drafts that should be refactored into a single linear tutorial. Furthermore, there is a functional error where the %%bqsql magic fails because the extension is not loaded in a code cell, and a hardcoded project ID needs to be replaced with a placeholder for user accessibility.

]
},
{
"cell_type": "code",
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.

high

The notebook contains significant redundancy and appears to be a combination of multiple drafts. Cells 2-9 perform data acquisition and preparation, Cell 10 contains a full tutorial in markdown text, and then Cells 11-14 repeat the data acquisition steps using different methods (e.g., wget instead of requests). The notebook should be refactored into a single, linear tutorial to improve maintainability and user experience.

}
],
"source": [
"%%bqsql df_with_year\n",
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.

high

The %%bqsql magic will fail because the bigframes extension has not been loaded in a code cell. The UsageError in the cell output at line 1684 confirms this. You must include a code cell with %load_ext bigframes before using the magic.

"# TODO(developer): Follow the instructions at\n",
"# https://docs.cloud.google.com/bigquery/docs/sandbox and set the project to the\n",
"# ID of the project you created.\n",
"bpd.options.bigquery.project = \"swena-bq-sandbox\""
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.

medium

The project ID is hardcoded to swena-bq-sandbox. This should be replaced with a placeholder like your-project-id to ensure that users are prompted to provide their own project ID, as indicated in the preceding comment and the tutorial text.

bpd.options.bigquery.project = "your-project-id"

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