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(bigquery): import Mapping from collections.abc not from collections by alextford11 · Pull Request #9826 · googleapis/google-cloud-python

Conversation

@alextford11

@alextford11 alextford11 commented Nov 19, 2019

Copy link
Copy Markdown
Contributor

Getting following deprecation warning in Bigquery:

File "/usr/local/lib/python3.7/dist-packages/google/cloud/bigquery/job.py", line 3216, in __iter__
    return iter(self.result())
  File "/usr/local/lib/python3.7/dist-packages/google/cloud/bigquery/job.py", line 3105, in result
    dest_table = Table(dest_table_ref, schema=schema)
  File "/usr/local/lib/python3.7/dist-packages/google/cloud/bigquery/table.py", line 335, in __init__
    self.schema = schema
  File "/usr/local/lib/python3.7/dist-packages/google/cloud/bigquery/table.py", line 400, in schema
    value = _to_schema_fields(value)
  File "/usr/local/lib/python3.7/dist-packages/google/cloud/bigquery/schema.py", line 284, in _to_schema_fields
    if not isinstance(field, (SchemaField, collections.Mapping)):
  File "/usr/lib/python3.7/collections/__init__.py", line 52, in __getattr__
    DeprecationWarning, stacklevel=2)
DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working

Sorry, something went wrong.

Uh oh!

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

samuelcolvin reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@alextford11
alextford11 requested a review from a team November 19, 2019 09:29
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 19, 2019
Alex Ford
fix(bigquery): import Mapping from collections.abc not from collections
b8152db
@alextford11 alextford11 changed the title import Mapping from collections.abc not from collections fix(bigquery): import Mapping from collections.abc not from collections Nov 19, 2019
tswast
tswast reviewed Nov 20, 2019
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.

When was the abc module added? If not until 3.x, we still need to account for compatibility with Python 2.7 for a little while longer.

Sorry, something went wrong.

Uh oh!

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

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

Uh oh!

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

Comment thread bigquery/google/cloud/bigquery/schema.py Resolved

Uh oh!

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

Alex Ford
fix(bigquery): importing module not class
f1a9c13
@tswast tswast added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 21, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 21, 2019
tswast
tswast approved these changes Nov 21, 2019
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.

Thanks!

Just kicked off the Kokoro CI tests. We can merge, assuming those pass.

Sorry, something went wrong.

Uh oh!

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

All reactions
samuelcolvin
samuelcolvin reviewed Nov 21, 2019
View reviewed changes

@samuelcolvin samuelcolvin left a comment

Copy link
Copy Markdown

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.

@tswast I know you like importing modules, not classes, but this is the canonical approach, anything else will be very unclear.

Sorry, something went wrong.

Uh oh!

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

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

Uh oh!

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

Comment thread bigquery/google/cloud/bigquery/schema.py Resolved

Uh oh!

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

@tswast
Use collections_abc import from six.
548c018
@tswast tswast added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 21, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 21, 2019
@tswast
tswast merged commit 0588f19 into googleapis:master Nov 21, 2019
@robert-l1

robert-l1 commented Dec 13, 2019

Copy link
Copy Markdown

I believe this update is causing issues with several versions of the BigQuery client class. My images are now throwing:

Traceback (most recent call last):
  File "test.py", line 20, in <module>
    from google.cloud import bigquery
  File "/usr/local/lib/python3.7/dist-packages/google/cloud/bigquery/__init__.py", line 35, in <module>
    from google.cloud.bigquery.client import Client
  File "/usr/local/lib/python3.7/dist-packages/google/cloud/bigquery/client.py", line 58, in <module>
    from google.cloud.bigquery import _pandas_helpers
  File "/usr/local/lib/python3.7/dist-packages/google/cloud/bigquery/_pandas_helpers.py", line 40, in <module>
    from google.cloud.bigquery import schema
  File "/usr/local/lib/python3.7/dist-packages/google/cloud/bigquery/schema.py", line 17, in <module>
    from six.moves import collections_abc
ImportError: cannot import name 'collections_abc' from 'six.moves' (unknown location)

I see the same in 2.7:

    from google.cloud import bigquery
  File "/usr/local/lib/python2.7/dist-packages/google/cloud/bigquery/__init__.py", line 35, in <module>
    from google.cloud.bigquery.client import Client
  File "/usr/local/lib/python2.7/dist-packages/google/cloud/bigquery/client.py", line 58, in <module>
    from google.cloud.bigquery import _pandas_helpers
  File "/usr/local/lib/python2.7/dist-packages/google/cloud/bigquery/_pandas_helpers.py", line 40, in <module>
    from google.cloud.bigquery import schema
  File "/usr/local/lib/python2.7/dist-packages/google/cloud/bigquery/schema.py", line 17, in <module>
    from six.moves import collections_abc
ImportError: cannot import name collections_abc
All reactions

Sorry, something went wrong.

Uh oh!

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

@tkrassowski

tkrassowski commented Dec 16, 2019

Copy link
Copy Markdown

@robert-l1
Upgrade your six package to newer version. Collections_abc support came in 1.13.1 (benjaminp/six#241).

robert-l1 and sweeneyb reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

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

@neteler

neteler commented Jan 8, 2020

Copy link
Copy Markdown

@robert-l1
Upgrade your six package to newer version. Collections_abc support came in 1.13.1

FWIW: So far six 1.13.0 is the latest release (https://pypi.org/project/six/) and seems to be sufficient.

All reactions

Sorry, something went wrong.

Uh oh!

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

This was referenced Jan 29, 2020
chore(bigquery): bump copyright year to 2020, tweak docstring formatting (via synth) #10225
Merged
[CHANGE ME] Re-generated container to pick up changes in the API or client library generator. #10256
Closed
[CHANGE ME] Re-generated datastore to pick up changes in the API or client library generator. #10261
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tswast tswast tswast approved these changes
+1 more reviewer
@samuelcolvin samuelcolvin samuelcolvin 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

cla: yes This human has signed the Contributor License Agreement.

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.

8 participants

@alextford11 @robert-l1 @tkrassowski @neteler @tswast @samuelcolvin @googlebot @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.