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!: BigQuery Storage and pyarrow are required dependencies by plamut · Pull Request #776 · googleapis/python-bigquery

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

Conversation

@plamut

@plamut plamut commented Jul 16, 2021 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Closes #757.

This might already be a final version, but I still need to check a few additional things:

  • Remove logic for "ensure client"? Or maybe not, since we still allow tabledata.list?
    We still need that.
  • Remove min version check for BQ Storage, since now it is guaranteed >=2.0.0 will be installed (no more pip quirks with extras).
    Done.
  • Remove checks for GAPIC? It's now a required dependency.
    Not applicable, the minimum GAPIC version was never checked at runtime.

PR checklist::

  • 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)

Sorry, something went wrong.

Uh oh!

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

All reactions
@product-auto-label product-auto-label Bot added the api: bigquery Issues related to the googleapis/python-bigquery API. label Jul 16, 2021
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Jul 16, 2021
@tswast tswast changed the title process: make BigQUery Storage and pyarrow required dependencies deps: BigQuery Storage and pyarrow are required dependencies Jul 16, 2021
plamut added 16 commits July 19, 2021 11:16
@plamut
process: make BQ Storage and pyarrow required
ba49697
@plamut
Make pyarrow required in _pandas_helpers.py
2c79152
@plamut
Make pyarrow required in client.py
137ae92
@plamut
Make pyarrow required in table.py
42c9606
@plamut
Make pyarrow required in job/query.py
5ae720d
@plamut
Make pyarrow required in DBAPI tests
ede0313
@plamut
Make pyarrow required in snippets tests
ce7f93d
@plamut
Make BQ storage required in client.py
3f7c456
@plamut
Make BQ storage required in table.py
ed412c0
@plamut
Make BQ storage required in DB API tests
ef905c2
@plamut
Make BQ storage required in magics.py
9c106f3
@plamut
Make BQ storage required in test__helpers.py
5438239
@plamut
Make BQ storage required in test__pandas_helpers.py
cfcc2d3
@plamut
Make BQ storage required in test_query_pandas.py
86c4533
@plamut
Make method signatures compatible again
560ccd6
The annotations caused a mismatch
@plamut
Remove checks for minimum BQ Storage version
e658d5a
Since this is now a required dependency, there should not be any more
pip quirks that used to allow installing BQ Storage as an extra, but
without always respecting its minimum version pin.
@plamut
plamut force-pushed the iss-757 branch from d7f0531 to e658d5a Compare July 19, 2021 20:28
@plamut
plamut marked this pull request as ready for review July 19, 2021 20:29
@plamut
plamut requested review from a team, loferris and tswast and removed request for a team July 19, 2021 20:29
@plamut

plamut commented Jul 19, 2021

Copy link
Copy Markdown
Contributor Author

@tswast It might be easier to review each commit separately, I tried to make them independent from each other. Also, double check if the assumption stated in the last commit's message really holds - if not, we can revert that bit.

All reactions

Sorry, something went wrong.

Uh oh!

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

tseaver
tseaver reviewed Jul 19, 2021
View reviewed changes
Comment thread setup.py Outdated
"google-resumable-media >= 0.6.0, < 3.0dev",
"packaging >= 14.3",
"protobuf >= 3.12.0",
"pyarrow >= 1.0.0, < 5.0dev",

@tseaver tseaver Jul 19, 2021

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.

Making these previously-optional dependencies now required feels like it might be a semver: major change.

Sorry, something went wrong.

Uh oh!

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

All reactions

@plamut plamut Jul 19, 2021

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.

IIRC @tswast said in a chat that it shouldn't be a problem for most users, and those who cannot install these dependencies for any reason can still pin to a lower (non-major version). But reading this as I write, we might actually want to re-consider this.

Sorry, something went wrong.

Uh oh!

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

All reactions

@plamut plamut Jul 19, 2021

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.

There has been a debate on this on the issue itself. Also copying Tim's input:

The gist is that the problematic dependencies are already required transitively anyway
With pyarrow being the exception
It's probably worth the bump for pyarrow if we're being conservative about it. Esp since we do know of environments where adding it will break

Sorry, something went wrong.

Uh oh!

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

tswast reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@tswast tswast Jul 19, 2021

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.

Let's go with the major version bump. I'd rather people adopt this change a little more slowly than break someone who has a working 2.x branch without pyarrow

Sorry, something went wrong.

Uh oh!

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

All reactions

@plamut plamut Jul 20, 2021

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.

Roger.

Is there perhaps anything else that we want to clean up and would be a breaking change? (possibly in a separate PR)
A major version bump is a good opportunity for that.

Sorry, something went wrong.

Uh oh!

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

All reactions

@tswast tswast Jul 20, 2021

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.

#319 is still on my mind. Perhaps easier now that proto-plus added more case options?

Sorry, something went wrong.

Uh oh!

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

All reactions

@tswast tswast Jul 20, 2021

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.

Another breaking change we might want to do: https://issuetracker.google.com/144712110 -- Better type conversions in the pandas connector.

Sorry, something went wrong.

Uh oh!

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

All reactions

@plamut plamut Jul 20, 2021 •
edited
Loading

Uh oh!

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

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.

And yet another one from today - maybe bumping the minimum pyarrow version, as the older ones suffer from a bug (load data from dataframe can upload incorrect data, yikes!)

Update: Done.

Sorry, something went wrong.

Uh oh!

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

All reactions

@tswast tswast Jul 20, 2021

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.

That is a nasty bug. Thankfully pyarrow didn't follow NEP-29 this time and kept support for Python 3.6 in the 4.x packages. I'd be okay with bumping the minimum for that.

Sorry, something went wrong.

Uh oh!

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

All reactions

@plamut plamut Jul 21, 2021

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.

And yet another - if this gets delayed significantly (read: months), we might want to consider dropping Python 3.6 support as well. But Python 3.6 end of life will only happen in December this year.

Sorry, something went wrong.

Uh oh!

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

All reactions
plamut
plamut commented Jul 19, 2021
View reviewed changes
Comment thread google/cloud/bigquery/exceptions.py Resolved

Uh oh!

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

plamut
plamut commented Jul 20, 2021
View reviewed changes
Comment thread setup.py Resolved

Uh oh!

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

tswast
tswast reviewed Jul 20, 2021
View reviewed changes
Comment thread tests/unit/test__pandas_helpers.py

# a warning should also be issued
expected_warnings = [
warning for warning in warned if "could not determine" in str(warning).lower()

@tswast tswast Jul 20, 2021

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.

Looks like the warning for this isn't issued anymore. I wonder if it's possible to get a dataframe without detectable schema if pyarrow is installed?

Sorry, something went wrong.

Uh oh!

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

All reactions

@plamut plamut Jul 22, 2021 •
edited
Loading

Uh oh!

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

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.

This particular test covered the case when we couldn't even start detecting the schema with pyarrow because the later was missing. This is not possible anymore, as pyarrow is now required, thus that particular warning has been removed.

However, we still call augment_schema() immediately after the deleted lines. That function can also issue a warning on its own if schema detection fails for some fields, but those paths are covered by other tests.

Edit: Whoops, that particular line is not covered, at least according to the coverage report.

Sorry, something went wrong.

Uh oh!

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

All reactions
@tswast

tswast commented Jul 20, 2021 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Edit: This is just an aside. No action required.

I'm pretty sure it would be possible to delete even more code such as

python-bigquery/google/cloud/bigquery/_pandas_helpers.py

Lines 542 to 554 in d1cbc38

def _row_iterator_page_to_dataframe(page, column_names, dtypes):
# Iterate over the page to force the API request to get the page data.
try:
next(iter(page))
except StopIteration:
pass
columns = {}
for column_index, column_name in enumerate(column_names):
dtype = dtypes.get(column_name)
columns[column_name] = pandas.Series(page._columns[column_index], dtype=dtype)
return pandas.DataFrame(columns, columns=column_names)
if we always have a BigQuery Storage API client, but there are a few cases where it can't be used.

For example: list_rows(table).to_dataframe() won't be able to use BQ Storage API from free tier. Also, when we implement #589 we'll need to use the REST API for that (at least in the single page of results case)

All reactions

Sorry, something went wrong.

Uh oh!

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

plamut added 2 commits July 21, 2021 18:45
@plamut
Bump minimum pyarrow version to 3.0.0
be5cf32
@plamut
Remove unneeded pytest.importorskip for BQ Storage
7960729
@plamut

plamut commented Jul 21, 2021

Copy link
Copy Markdown
Contributor Author

As a follow-up to #781 I also bumped the minimum pyarrow version.

All reactions

Sorry, something went wrong.

Uh oh!

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

@tseaver

tseaver commented Jul 21, 2021

Copy link
Copy Markdown
Contributor

Failing systest is another instance of #733.

All reactions

Sorry, something went wrong.

Uh oh!

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

plamut added 5 commits July 22, 2021 13:53
@plamut
Merge branch 'master' into iss-757
b5475d5
@plamut
Remove pyarrow version checks in pandas helpers tests
c0b810b
@plamut
Conditionally skip pandas tests where needed
8d127cf
@plamut
Remove unneeded conditional pyarrow version paths
e47f1bd
@plamut
Cover schema autodetect failed code path in test
427665e
plamut
plamut commented Jul 22, 2021
View reviewed changes
Comment thread google/cloud/bigquery/client.py Outdated

@plamut plamut Jul 22, 2021

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.

This warning was removed because the just-fixed bug will not come into play once we require pyarrow > 3.0.0.

Sorry, something went wrong.

Uh oh!

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

All reactions
@tswast tswast added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 22, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 22, 2021
@plamut
plamut requested a review from tswast July 23, 2021 06:36
tswast added 2 commits July 27, 2021 12:10
@tswast
Merge branch 'master' into iss-757
820b092
@tswast
fix bad merge
c4315ce
@tswast
tswast changed the base branch from master to v3.x.x July 27, 2021 17:21
@tswast
tswast changed the base branch from v3.x.x to v3 July 27, 2021 17:28
tswast
tswast approved these changes Jul 27, 2021
View reviewed changes

@tswast tswast 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.

This is awesome!

FYI: I pointed this PR at the v3 branch. Should be safe to merge.

Sorry, something went wrong.

Uh oh!

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

All reactions
@tswast
tswast merged commit 9cd7554 into googleapis:v3 Jul 27, 2021
@plamut
plamut deleted the iss-757 branch July 28, 2021 07:17
@tswast tswast mentioned this pull request Oct 6, 2021
pull google-cloud-bigquery-storage and pyarrow into required dependencies #757
Closed
@tswast tswast mentioned this pull request Mar 29, 2022
fix!: remove out-of-date BigQuery ML protocol buffers #1178
Merged
4 tasks
tswast added a commit that referenced this pull request Mar 29, 2022
@tswast
fix!: remove out-of-date BigQuery ML protocol buffers (#1178)
76d88fb
deps!: BigQuery Storage and pyarrow are required dependencies (#776)

fix!: use nullable `Int64` and `boolean` dtypes in `to_dataframe` (#786) 

feat!: destination tables are no-longer removed by `create_job` (#891)

feat!: In `to_dataframe`, use `dbdate` and `dbtime` dtypes from db-dtypes package for BigQuery DATE and TIME columns (#972)

fix!: automatically convert out-of-bounds dates in `to_dataframe`, remove `date_as_object` argument (#972)

feat!: mark the package as type-checked (#1058)

feat!: default to DATETIME type when loading timezone-naive datetimes from Pandas (#1061)

feat: add `api_method` parameter to `Client.query` to select `INSERT` or `QUERY` API (#967)

fix: improve type annotations for mypy validation (#1081)

feat: use `StandardSqlField` class for `Model.feature_columns` and `Model.label_columns` (#1117)

docs: Add migration guide from version 2.x to 3.x (#1027)

Release-As: 3.0.0
@release-please release-please Bot mentioned this pull request Mar 29, 2022
chore(main): release 3.0.0 #1179
Merged
@tswast tswast mentioned this pull request Apr 13, 2022
New dependency on pyarrow introduces heavyweight numpy sub-dependency #1196
Closed
@steffnay steffnay mentioned this pull request Jul 15, 2022
deps: make pyarrow and BQ Storage optional dependencies #1282
Merged
waltaskew pushed a commit to waltaskew/python-bigquery that referenced this pull request Jul 20, 2022
@tswast @waltaskew
fix!: remove out-of-date BigQuery ML protocol buffers (googleapis#1178)
e049810
deps!: BigQuery Storage and pyarrow are required dependencies (googleapis#776)

fix!: use nullable `Int64` and `boolean` dtypes in `to_dataframe` (googleapis#786) 

feat!: destination tables are no-longer removed by `create_job` (googleapis#891)

feat!: In `to_dataframe`, use `dbdate` and `dbtime` dtypes from db-dtypes package for BigQuery DATE and TIME columns (googleapis#972)

fix!: automatically convert out-of-bounds dates in `to_dataframe`, remove `date_as_object` argument (googleapis#972)

feat!: mark the package as type-checked (googleapis#1058)

feat!: default to DATETIME type when loading timezone-naive datetimes from Pandas (googleapis#1061)

feat: add `api_method` parameter to `Client.query` to select `INSERT` or `QUERY` API (googleapis#967)

fix: improve type annotations for mypy validation (googleapis#1081)

feat: use `StandardSqlField` class for `Model.feature_columns` and `Model.label_columns` (googleapis#1117)

docs: Add migration guide from version 2.x to 3.x (googleapis#1027)

Release-As: 3.0.0
abdelmegahedgoogle pushed a commit to abdelmegahedgoogle/python-bigquery that referenced this pull request Apr 17, 2023
@tswast @abdelmegahedgoogle
fix!: remove out-of-date BigQuery ML protocol buffers (googleapis#1178)
6ec1bf3
deps!: BigQuery Storage and pyarrow are required dependencies (googleapis#776)

fix!: use nullable `Int64` and `boolean` dtypes in `to_dataframe` (googleapis#786) 

feat!: destination tables are no-longer removed by `create_job` (googleapis#891)

feat!: In `to_dataframe`, use `dbdate` and `dbtime` dtypes from db-dtypes package for BigQuery DATE and TIME columns (googleapis#972)

fix!: automatically convert out-of-bounds dates in `to_dataframe`, remove `date_as_object` argument (googleapis#972)

feat!: mark the package as type-checked (googleapis#1058)

feat!: default to DATETIME type when loading timezone-naive datetimes from Pandas (googleapis#1061)

feat: add `api_method` parameter to `Client.query` to select `INSERT` or `QUERY` API (googleapis#967)

fix: improve type annotations for mypy validation (googleapis#1081)

feat: use `StandardSqlField` class for `Model.feature_columns` and `Model.label_columns` (googleapis#1117)

docs: Add migration guide from version 2.x to 3.x (googleapis#1027)

Release-As: 3.0.0
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@loferris loferris Awaiting requested review from loferris
2 more reviewers
@tseaver tseaver tseaver left review comments
@tswast tswast tswast approved these changes
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

api: bigquery Issues related to the googleapis/python-bigquery API. cla: yes This human has signed the Contributor License Agreement. semver: major Hint for users that this is an API breaking change.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

pull google-cloud-bigquery-storage and pyarrow into required dependencies

Uh oh!

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

5 participants

@plamut @busunkim96 @tswast @tseaver @yoshi-kokoro
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.