GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(bigframes): fix mypy errors in _magics.py related to get_ipython by tswast · Pull Request #17979 · googleapis/google-cloud-python

Conversation

@tswast

@tswast tswast commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Fixes mypy error in bigframes/_magics.py caused by get_ipython() potentially returning None.

The issue was seen as:

nox > mypy bigframes tests/system tests/unit --check-untyped-defs --explicit-package-bases '--exclude="^third_party"'
bigframes/_magics.py:44: error: Item "None" of "InteractiveShell | None" has no attribute "user_ns"  [union-attr]
bigframes/_magics.py:49: error: Item "None" of "InteractiveShell | None" has no attribute "push"  [union-attr]

Resolved by adding a guard clause that checks if ipython is None, which then raises a RuntimeError, naturally helping mypy narrow down the types.


PR created automatically by Jules for task 13181547226489082485 started by @tswast

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gemini-code-assist[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction
@google-labs-jules @tswast
fix(bigframes): resolve mypy error for get_ipython returning None
56a3f57
Added a None check for `ipython` retrieved using `get_ipython()` in `bigframes/_magics.py` to prevent mypy `union-attr` errors when accessing `ipython.user_ns` and `ipython.push`. If `ipython` is None, a `RuntimeError` is raised indicating that the magic must be run in an IPython environment.

Co-authored-by: tswast <[email protected]>
@google-labs-jules

google-labs-jules Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tswast
tswast requested review from a team as code owners August 3, 2026 16:58
@tswast
tswast requested review from shuoweil and removed request for a team August 3, 2026 16:58
gemini-code-assist[bot]
gemini-code-assist Bot reviewed Aug 3, 2026
View reviewed changes

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

Copy link
Copy Markdown
Contributor

There was a problem hiding this 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 updates the _cell_magic function in packages/bigframes/bigframes/_magics.py to check if the IPython environment is available. If get_ipython() returns None, it now raises a RuntimeError indicating that the BigQuery magic must be run in an IPython environment. There are no review comments, and I have no feedback to provide.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
shuoweil
shuoweil approved these changes Aug 3, 2026
View reviewed changes
@shuoweil
shuoweil merged commit 24d955e into main Aug 3, 2026
42 of 43 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@shuoweil
shuoweil deleted the fix-mypy-ipython-none-check-13181547226489082485 branch August 3, 2026 18:09
@release-please release-please Bot mentioned this pull request Aug 3, 2026
chore(main): release bigframes 2.47.0 #17800
Merged
tswast pushed a commit that referenced this pull request Aug 3, 2026
@release-please
chore(main): release bigframes 2.47.0 (#17800)
654a96f
🤖 I have created a release *beep* *boop*
---


##
[2.47.0](bigframes-v2.46.0...bigframes-v2.47.0)
(2026-08-03)


### Features

* **bigframes:** add ai.embed and ai.similarity to bigquery accessor
([#17927](#17927))
([2d1372b](2d1372b))


### Bug Fixes

* **bigframes:** fix mypy errors in _magics.py related to get_ipython
([#17979](#17979))
([24d955e](24d955e))
* bump brace-expansion from 5.0.6 to 5.0.7 in
/packages/bigframes/bigframes/display/table_widget_angular
([#17794](#17794))
([2df1bb5](2df1bb5))
* bump fast-uri from 3.1.1 to 3.1.4 in
/packages/bigframes/bigframes/display/table_widget_angular
([#17828](#17828))
([8ce495a](8ce495a))
* bump hono from 4.12.16 to 4.12.31 in
/packages/bigframes/bigframes/display/table_widget_angular
([#17829](#17829))
([6d6fa39](6d6fa39))
* bump immutable from 5.1.7 to 5.1.9 in
/packages/bigframes/bigframes/display/table_widget_angular
([#17830](#17830))
([6abb1da](6abb1da))
* bump postcss from 8.5.14 to 8.5.23 in
/packages/bigframes/bigframes/display/table_widget_angular
([#17908](#17908))
([e68eb8f](e68eb8f))
* bump tar from 7.5.16 to 7.5.20 in
/packages/bigframes/bigframes/display/table_widget_angular
([#17793](#17793))
([3502d41](3502d41))
* require Protobuf 6.33.5+
([#17743](#17743))
([d267342](d267342))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
@parthea parthea mentioned this pull request Aug 4, 2026
fix: remove stray debug print in RangeQueryParameter constructor #17973
Merged
copybara-service Bot pushed a commit to google/bigframes that referenced this pull request Aug 12, 2026
@release-please @copybara-github
chore(main): release bigframes 2.47.0 (#17800)
7cf63e5
🤖 I have created a release *beep* *boop*
---

##
[2.47.0](googleapis/google-cloud-python@bigframes-v2.46.0...bigframes-v2.47.0)
(2026-08-03)

### Features

* **bigframes:** add ai.embed and ai.similarity to bigquery accessor
([#17927](googleapis/google-cloud-python#17927))
([2d1372b](googleapis/google-cloud-python@2d1372b))

### Bug Fixes

* **bigframes:** fix mypy errors in _magics.py related to get_ipython
([#17979](googleapis/google-cloud-python#17979))
([24d955e](googleapis/google-cloud-python@24d955e))
* bump brace-expansion from 5.0.6 to 5.0.7 in
/packages/bigframes/bigframes/display/table_widget_angular
([#17794](googleapis/google-cloud-python#17794))
([2df1bb5](googleapis/google-cloud-python@2df1bb5))
* bump fast-uri from 3.1.1 to 3.1.4 in
/packages/bigframes/bigframes/display/table_widget_angular
([#17828](googleapis/google-cloud-python#17828))
([8ce495a](googleapis/google-cloud-python@8ce495a))
* bump hono from 4.12.16 to 4.12.31 in
/packages/bigframes/bigframes/display/table_widget_angular
([#17829](googleapis/google-cloud-python#17829))
([6d6fa39](googleapis/google-cloud-python@6d6fa39))
* bump immutable from 5.1.7 to 5.1.9 in
/packages/bigframes/bigframes/display/table_widget_angular
([#17830](googleapis/google-cloud-python#17830))
([6abb1da](googleapis/google-cloud-python@6abb1da))
* bump postcss from 8.5.14 to 8.5.23 in
/packages/bigframes/bigframes/display/table_widget_angular
([#17908](googleapis/google-cloud-python#17908))
([e68eb8f](googleapis/google-cloud-python@e68eb8f))
* bump tar from 7.5.16 to 7.5.20 in
/packages/bigframes/bigframes/display/table_widget_angular
([#17793](googleapis/google-cloud-python#17793))
([3502d41](googleapis/google-cloud-python@3502d41))
* require Protobuf 6.33.5+
([#17743](googleapis/google-cloud-python#17743))
([d267342](googleapis/google-cloud-python@d267342))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
GitOrigin-RevId: 654a96f867c8b749702027d6c3d39f3864c48081
Change-Id: I942ec3bf4556b4c325f4b0acd3a0759ce4139dc2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@shuoweil shuoweil shuoweil approved these changes
+1 more reviewer
@gemini-code-assist gemini-code-assist[bot] gemini-code-assist[bot] left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@tswast @shuoweil
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.