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 — deps: use pandas-gbq to determine schema in `load_table_from_dataframe` by tswast · Pull Request #2095 · googleapis/python-bigquery

This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Conversation

@tswast

@tswast tswast commented Dec 26, 2024

Copy link
Copy Markdown
Contributor

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)

Towards go/pandas-gbq-and-bigframes-redundancy
🦕

Sorry, something went wrong.

Uh oh!

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

Bravefriend82 reacted with laugh emoji
All reactions
  • 😄 1 reaction
@tswast
feat: use pandas-gbq to determine schema in load_table_from_dataframe
b8ff031
@tswast
tswast requested review from a team and chalmerlowe December 26, 2024 22:28
@product-auto-label product-auto-label Bot added the size: m Pull request size is medium. label Dec 26, 2024
@blunderbuss-gcf blunderbuss-gcf Bot assigned yirutang Dec 26, 2024
@product-auto-label product-auto-label Bot added the api: bigquery Issues related to the googleapis/python-bigquery API. label Dec 26, 2024
@gcf-owl-bot
🦉 Updates from OwlBot post-processor
04a9f11
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
@tswast

tswast commented Dec 27, 2024

Copy link
Copy Markdown
Contributor Author

tests/unit/test_client.py::TestClientUpload::test_load_table_from_dataframe_w_higher_scale_decimal128_datatype looks like a real failure and might need a change in pandas-gbq.

All reactions

Sorry, something went wrong.

Uh oh!

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

tswast and others added 5 commits December 27, 2024 12:56
@tswast
fix some unit tests
be2dd1b
@tswast
Merge remote-tracking branch 'origin/b323176126-pandas-gbq' into b323…
6a13cab
…176126-pandas-gbq
@gcf-owl-bot
🦉 Updates from OwlBot post-processor
1606cd6
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
@tswast
Merge remote-tracking branch 'origin/main' into b323176126-pandas-gbq
2ae1121
@gcf-owl-bot
🦉 Updates from OwlBot post-processor
e90cdfb
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
@tswast tswast mentioned this pull request Jan 3, 2025
fix: ensure BIGNUMERIC type is used if scale > 9 in Decimal values googleapis/python-bigquery-pandas#844
Merged
4 tasks
@tswast

tswast commented Jan 3, 2025

Copy link
Copy Markdown
Contributor Author

I've tested locally with googleapis/python-bigquery-pandas#844 and that PR should fix the remaining system test.

(venv) ➜  python-bigquery git:(b323176126-pandas-gbq) pytest tests/unit/test_client.py::TestClientUpload::test_load_table_from_dataframe_w_higher_scale_decimal128_datatype
==================================================== test session starts ====================================================
platform linux -- Python 3.12.6, pytest-8.3.4, pluggy-1.5.0
rootdir: /home/swast/src/github.com/googleapis/python-bigquery
configfile: pyproject.toml
collected 1 item                                                                                                            

tests/unit/test_client.py .                                                                                           [100%]

===================================================== 1 passed in 0.08s =====================================================
All reactions

Sorry, something went wrong.

Uh oh!

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

tswast
tswast commented Jan 3, 2025
View reviewed changes
Comment thread pyproject.toml Resolved

Uh oh!

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

tswast added 2 commits January 7, 2025 09:56
@tswast
Merge remote-tracking branch 'origin/main' into b323176126-pandas-gbq
61f035b
@tswast
bump minimum pandas-gbq to 0.26.1
29f336a
@tswast tswast changed the title feat: use pandas-gbq to determine schema in load_table_from_dataframe deps: use pandas-gbq to determine schema in load_table_from_dataframe Jan 7, 2025
@tswast
tswast requested a review from Linchin January 7, 2025 15:58
gcf-owl-bot Bot and others added 4 commits January 7, 2025 15:59
@gcf-owl-bot
🦉 Updates from OwlBot post-processor
aff7021
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
@tswast
Merge branch 'main' into b323176126-pandas-gbq
ce368d9
@tswast
Merge remote-tracking branch 'origin/main' into b323176126-pandas-gbq
9b7583e
@tswast
drop pandas-gbq from python 3.7 extras
f0ef613
@tswast

tswast commented Jan 22, 2025

Copy link
Copy Markdown
Contributor Author

test_load_table_from_dataframe_w_partial_schema_extra_types

Looks like a real failure (the warning message changed slightly in pandas-gbq). I'll try to update the test to be a bit more robust.

All reactions

Sorry, something went wrong.

Uh oh!

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

tswast added 3 commits January 22, 2025 16:46
@tswast
Merge remote-tracking branch 'origin/main' into b323176126-pandas-gbq
8f46e3d
@tswast
relax warning message text assertion
f4c1a4f
@tswast
use consistent time zone presense/absense in time datetime system test
76b7890
@tswast tswast added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 23, 2025
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 23, 2025
@tswast

tswast commented Jan 23, 2025

Copy link
Copy Markdown
Contributor Author

@Linchin @chalmerlowe I believe this is finally ready for review. The failing checks are for infrastructure / Kokoro problems for a new setup, possibly?

All reactions

Sorry, something went wrong.

Uh oh!

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

tswast
tswast commented Jan 27, 2025
View reviewed changes
Comment thread google/cloud/bigquery/_pandas_helpers.py Resolved

Uh oh!

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

@tswast
Update google/cloud/bigquery/_pandas_helpers.py
d382e13
tswast
tswast commented Jan 27, 2025
View reviewed changes
Comment thread tests/system/test_pandas.py
dict(
dt=[
datetime.datetime(2020, 1, 8, 8, 0, 0),
datetime.datetime(2020, 1, 8, 8, 0, 0, tzinfo=datetime.timezone.utc),

@tswast tswast Jan 27, 2025

Copy link
Copy Markdown
Contributor Author

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.

Not sure is we should have defined what happens when you mix and match naive datetime (DATETIME in BQ) with datetime + timezone (TIMESTAMP in BQ). Since the test expects TIMESTAMP, I update this to be a datetime + timezone.

We still mix/match timezones, so I think that part is important to make sure we end up returning UTC values.

Sorry, something went wrong.

Uh oh!

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

All reactions
chalmerlowe
chalmerlowe reviewed Jan 28, 2025
View reviewed changes

@chalmerlowe chalmerlowe left a comment

Copy link
Copy Markdown
Collaborator

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.

By and large, this looks good.
I have a question that might be a potential blocker.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread google/cloud/bigquery/_pandas_helpers.py Resolved

Uh oh!

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

@tswast @chalmerlowe
Update google/cloud/bigquery/_pandas_helpers.py
672ae33
Co-authored-by: Chalmer Lowe <[email protected]>
tswast
tswast commented Jan 28, 2025
View reviewed changes
Comment thread pyproject.toml
]
pandas = [
"pandas >= 1.1.0",
"pandas-gbq >= 0.26.1; python_version >= '3.8'",

@tswast tswast Jan 28, 2025

Copy link
Copy Markdown
Contributor Author

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.

Note: this means we are testing without pandas-gbq on Python 3.7.

Sorry, something went wrong.

Uh oh!

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

All reactions
tswast added 4 commits February 3, 2025 12:42
@tswast
Merge branch 'main' into b323176126-pandas-gbq
155528c
@tswast
Merge remote-tracking branch 'origin/main' into b323176126-pandas-gbq
5a5e1b4
@tswast
remove pandas-gbq from at least 1 unit test and system test session
9a5656b
@tswast
Merge remote-tracking branch 'origin/b323176126-pandas-gbq' into b323…
1fab458
…176126-pandas-gbq
@tswast

tswast commented Feb 5, 2025

Copy link
Copy Markdown
Contributor Author

@chalmerlowe In 9a5656b I have explicitly uninstalled pandas-gbq in at least one unit and system test version. This should be robust to when we drop Python 3.7 and 3.8. I have verified the pip freeze output locally to confirm that pandas-gbq is not present in the sessions where we uninstall it.

All reactions

Sorry, something went wrong.

Uh oh!

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

@tswast tswast mentioned this pull request Feb 18, 2025
catch pyarrow.lib.ArrowTypeError for augment_schema googleapis/google-cloud-python#15698
Closed
@tswast
Merge branch 'main' into b323176126-pandas-gbq
008aea3
chalmerlowe
chalmerlowe approved these changes Feb 18, 2025
View reviewed changes

@chalmerlowe chalmerlowe left a comment

Copy link
Copy Markdown
Collaborator

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.

LGTM.
Approved.

Sorry, something went wrong.

Uh oh!

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

All reactions
@tswast
tswast enabled auto-merge (squash) February 18, 2025 22:35
@tswast
tswast merged commit 7603bd7 into main Feb 21, 2025
@tswast
tswast deleted the b323176126-pandas-gbq branch February 21, 2025 17:45
@release-please release-please Bot mentioned this pull request Feb 21, 2025
chore(main): release 3.30.0 #2119
Merged
chalmerlowe added a commit that referenced this pull request Feb 21, 2025
@tswast @gcf-owl-bot @chalmerlowe
deps: use pandas-gbq to determine schema in `load_table_from_datafram…
b2d6e0a
…e` (#2095)

* feat: use pandas-gbq to determine schema in `load_table_from_dataframe`

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* fix some unit tests

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* bump minimum pandas-gbq to 0.26.1

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* drop pandas-gbq from python 3.7 extras

* relax warning message text assertion

* use consistent time zone presense/absense in time datetime system test

* Update google/cloud/bigquery/_pandas_helpers.py

* Update google/cloud/bigquery/_pandas_helpers.py

Co-authored-by: Chalmer Lowe <[email protected]>

* remove pandas-gbq from at least 1 unit test and system test session

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Chalmer Lowe <[email protected]>
chalmerlowe added a commit that referenced this pull request Feb 28, 2025
@chalmerlowe @gcf-owl-bot @tswast
deps: Remove Python 3.7 and 3.8 as supported runtimes (#2133)
fb7de39
* Initial batch of changes to remove 3.7 and 3.8

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* more updates to remove 3.7 and 3.8

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* updates samples/geography/reqs

* updates samples/magics/reqs

* updates samples/notebooks/reqs

* updates linting

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* updates conf due to linting issue

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* updates reqs.txt, fix mypy, lint, and debug in noxfile

* Updates owlbot to correct spacing issue in conf.py

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* updates owlbot imports

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* removes kokoro samples configs for 3.7 & 3.8

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* removes owlbots attempt to restore kokoro samples configs

* removes kokoro system-3.8.cfg

* edits repo sync settings

* updates assorted noxfiles for samples and pyproject.toml

* update test-samples-impl.sh

* updates install_deps template

* Edits to the contributing documentation

* deps: use pandas-gbq to determine schema in `load_table_from_dataframe` (#2095)

* feat: use pandas-gbq to determine schema in `load_table_from_dataframe`

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* fix some unit tests

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* bump minimum pandas-gbq to 0.26.1

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* drop pandas-gbq from python 3.7 extras

* relax warning message text assertion

* use consistent time zone presense/absense in time datetime system test

* Update google/cloud/bigquery/_pandas_helpers.py

* Update google/cloud/bigquery/_pandas_helpers.py

Co-authored-by: Chalmer Lowe <[email protected]>

* remove pandas-gbq from at least 1 unit test and system test session

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Chalmer Lowe <[email protected]>

* Feat: Adds foreign_type_info attribute to table class and adds unit tests. (#2126)

* adds foreign_type_info attribute to table

* feat: Adds foreign_type_info attribute and tests

* updates docstrings for foreign_type_info

* Updates property handling, especially as regards set/get_sub_prop

* Removes extraneous comments and debug expressions

* Refactors build_resource_from_properties w get/set_sub_prop

* updates to foreign_type_info, tests and wiring

* Adds logic to detect non-Sequence schema.fields value

* updates assorted tests and logic

* deps: updates required checks list in github (#2136)

* deps: updates required checks list in github

* deps: updates snippet and system checks in github to remove 3.9

* changes the order of two items in the list.

* updates linting

* reverts pandas back to 1.1.0

* Revert changes related to pandas <1.5

* Revert noxfile.py changes related to pandas <1.5

* Revert constraints-3.9 changes related to pandas <1.5

* Revert test_query_pandas.py changes related to pandas <1.5

* Revert test__pandas_helpers.py changes related to pandas <1.5

* Revert test__versions_helpers.py changes related to pandas <1.5

* Revert tnoxfile.py changes related to pandas <1.5

* Revert test__versions_helpers.py changes related to pandas <1.5

* Revert test_table.py changes related to pandas <1.5

* Update noxfile changes related to pandas <1.5

* Update pyproject.toml changes related to pandas <1.5

* Update constraints-3.9.txt changes related to pandas <1.5

* Update test_legacy_types.py changes related to pandas <1.5

* Updates magics.py as part of reverting from pandas 1.5

* Updates noxfile.py in reverting from pandas 1.5

* Updates pyproject.toml in reverting from pandas 1.5

* Updates constraints.txt in reverting from pandas 1.5

* Updates test_magics in reverting from pandas 1.5

* Updates test_table in reverting from pandas 1.5

* Updates in tests re: reverting from pandas 1.5

* Updates pyproject to match constraints.txt

* updates pyproject.toml to mirror constraints

* remove limit on virtualenv

* updates owlbot.py for test-samples-impl.sh

* updates to owlbot.py

* updates to test-samples-impl.sh

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* further updates to owlbot.py

* removes unneeded files

* adds presubmit.cfg back in

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Tim Sweña (Swast) <[email protected]>
This was referenced Mar 4, 2025
March 03, 2025 kitta65/bq-extension-vscode#678
Closed
March 03, 2025 kitta65/prettier-plugin-bq#614
Closed
March 03, 2025 kitta65/bq2cst#480
Closed
@tswast tswast mentioned this pull request May 30, 2025
feat: allow loading table from dataframe with extra fields, #1812 #2165
Closed
4 tasks done
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@Linchin Linchin Awaiting requested review from Linchin
1 more reviewer
@chalmerlowe chalmerlowe chalmerlowe approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

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

Assignees

@yirutang yirutang

Labels

api: bigquery Issues related to the googleapis/python-bigquery API. size: m Pull request size is medium.

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.

4 participants

@tswast @chalmerlowe @kokoro-team @yirutang
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.