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

chore: remove workarounds for BQ Storage issue with small result sets#133

Merged
plamut merged 3 commits intogoogleapis:masterfrom
plamut:iss-106
Jun 15, 2020
Merged

chore: remove workarounds for BQ Storage issue with small result sets#133
plamut merged 3 commits intogoogleapis:masterfrom
plamut:iss-106

Conversation

@plamut
Copy link
Copy Markdown
Contributor

@plamut plamut commented Jun 12, 2020

Closes #106.

This PR removes workarounds the BQ Storage bug with small anonymous result sets that has been fixed recently, rendering those workarounds obsolete.

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)

@plamut plamut added the type: cleanup An internal cleanup or hygiene concern. label Jun 12, 2020
@plamut plamut requested a review from shollyman June 12, 2020 17:52
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 12, 2020
Comment thread tests/unit/test_job.py
job = self._make_one(self.JOB_ID, self.QUERY, client)

tbl = job.to_arrow()
tbl = job.to_arrow(create_bqstorage_client=False)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Before this PR, a BigQuery Storage client was automatically created (a default) behind the scenes and actually hit the backend, but only to trigger a 401 Unauthorized error and fall back to the tabledata.list API that uses the (mocked) BigQuery client.

These create_bqstorage_client=False additions ensure that tests behave as before, i.e. using the (mocked) BigQuery client, but without a futile attempt with a real BQ Storage client.

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.

Thanks for clarifying

@plamut
Copy link
Copy Markdown
Contributor Author

plamut commented Jun 12, 2020

Some issue started occurring under Python 2.7 all of a sudden:

SyntaxError: Non-ASCII character '\xc3' in file /tmpfs/src/github/python-bigquery/.nox/unit-2-7/lib/python2.7/site-packages/rsa/key.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

Seems like the rsa dependency is broken, a new version was released just half an hour ago - https://pypi.org/project/rsa/#history

Edit: Looking at the release notes, it seems that they dropped Python 2.7 support in version 4.1 already, but forgot to tag it as such. We need to pin rsa to an older version...

Edit 2: Will be fixed in #135.

Copy link
Copy Markdown
Contributor

@shollyman shollyman left a comment

Choose a reason for hiding this comment

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

Thanks for cleaning this up.

Comment thread google/cloud/bigquery/dbapi/connection.py Outdated
Comment thread google/cloud/bigquery/dbapi/connection.py Outdated
Comment thread tests/unit/test_job.py
job = self._make_one(self.JOB_ID, self.QUERY, client)

tbl = job.to_arrow()
tbl = job.to_arrow(create_bqstorage_client=False)
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.

Thanks for clarifying

@plamut plamut merged commit cb16cfd into googleapis:master Jun 15, 2020
@plamut plamut deleted the iss-106 branch June 15, 2020 10:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes This human has signed the Contributor License Agreement. type: cleanup An internal cleanup or hygiene concern.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove workarounds for the BQ Storage API issue with small result sets

3 participants