Repository: googleapis/google-cloud-python

Issue:
Bigquery: import error with v.1.23.0
#### Steps to reproduce

  1. Using google.cloud.bigquery v.1.23.0
 - https://pypi.org/project/google-cloud-bigquery/1.23.0/
  2. Insead of v.1.22.0 works fine. 

#### Code example

```python
from concurrent.futures import ThreadPoolExecutor
from logging import StreamHandler, Formatter, INFO, getLogger
from datetime import datetime, timedelta, timezone
 
from google.cloud import bigquery
from google.cloud.bigquery import LoadJobConfig
from google.cloud.bigquery import SchemaField
```

#### Stack trace
```
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<command-778378> in <module>
      3 from datetime import datetime, timedelta, timezone
      4 
----> 5 from google.cloud import bigquery
      6 from google.cloud.bigquery import LoadJobConfig
      7 from google.cloud.bigquery import SchemaField

/databricks/python/lib/python3.7/site-packages/google/cloud/bigquery/__init__.py in <module>
     33 __version__ = get_distribution("google-cloud-bigquery").version
     34 
---> 35 from google.cloud.bigquery.client import Client
     36 from google.cloud.bigquery.dataset import AccessEntry
     37 from google.cloud.bigquery.dataset import Dataset

/databricks/python/lib/python3.7/site-packages/google/cloud/bigquery/client.py in <module>
     56 from google.cloud.bigquery._helpers import _verify_job_config_type
     57 from google.cloud.bigquery._http import Connection
---> 58 from google.cloud.bigquery import _pandas_helpers
     59 from google.cloud.bigquery.dataset import Dataset
     60 from google.cloud.bigquery.dataset import DatasetListItem

/databricks/python/lib/python3.7/site-packages/google/cloud/bigquery/_pandas_helpers.py in <module>
     38     pyarrow = None
     39 
---> 40 from google.cloud.bigquery import schema
     41 
     42 

/databricks/python/lib/python3.7/site-packages/google/cloud/bigquery/schema.py in <module>
     15 """Schemas for BigQuery tables / queries."""
     16 
---> 17 from six.moves import collections_abc
     18 
     19 from google.cloud.bigquery_v2 import types

ImportError: cannot import name 'collections_abc' from 'six.moves' (unknown location)
```



Discussion:
I can reproduce the same behavior
My pipeline broke today. I install `google-cloud-bigquery` using bootstrap script  while creating dataproc cluster and i'm getting the following error after submitting my spark job :

```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
```
So i've migrated to previous version(1.22.0) and it's working fine. 
@smdmts @shihabuddinbuet @SaschaHeyer Please update or install the latest version of `six` which is  `1.13.0`. It's due to the  older version `six`  like `1.12.0`.
@HemangChothani 
Shouldn't it work out of the box after installing `google.cloud.bigquery`without any need to install further packages?
@SaschaHeyer  `google.cloud.bigquery` install required packages ,but due to some reason package `six` hasn't been updated. Updated version of `six` works for me.
Can reproduce the same
Adding `six==1.13.0` to the requirements file of the main project worked for me
Please verify via python -m pip freeze that this python environment has up to date packages. In a clean environment this seems to work.
    
    $ python -m pip freeze
    cachetools==3.1.1
    certifi==2019.11.28
    chardet==3.0.4
    google-api-core==1.14.3
    google-auth==1.7.2
    google-cloud-core==1.1.0
    google-cloud-iam==0.2.1
    google-cloud-bigquery==1.23.0
    googleapis-common-protos==1.6.0
    idna==2.8
    protobuf==3.11.1
    pyasn1==0.4.8
    pyasn1-modules==0.2.7
    pytz==2019.3
    requests==2.22.0
    rsa==4.0
    six==1.13.0
    urllib3==1.25.7

And the imports work as expected.

    [GCC 8.3.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from google.cloud import bigquery
    >>> from google.cloud.bigquery import LoadJobConfig
    
feel free to reopen  if this wouldn't solve the problem.
Hi,

Would it be possible for either `google-cloud-bigquery` to explicitly list that it requires `six >= 1.13.0`, or for `google-cloud-core` to increase its lower bound and `google-cloud-bigquery` require the new version?

The problem is that `pip install --upgrade` on projects that depend upon `google-cloud-bigquery` now fail, because `google-cloud-core` incorrectly asserts that it only needs `six >= 1.10.0` (see [here](https://github.com/googleapis/google-cloud-python/blob/68c2cc8b2804a57422f59a70ea9b9f9fd534e4d9/api_core/setup.py#L37)).

I agree that this problem can be fixed by manually upgrading `six`, but the point of listing dependencies and their versions is that this happens automatically.
Sorry that you have encountered this issue. I should have checked the minimum version of `six` for the `collections.abc` fix for Python 3.8. I do see it was added in 1.13.0. https://github.com/benjaminp/six/blob/203b81c2a719466ed13681f0062a4426c07c7481/CHANGES#L11

Indeed, the correct fix is for bigquery to add `six >=1.13.0,<2.0.0dev` as a dependency in setup.py.

Resolving patch:
diff --git a/bigquery/setup.py b/bigquery/setup.py
--- a/bigquery/setup.py
+++ b/bigquery/setup.py
@@ -33,6 +33,7 @@
     "google-cloud-core >= 1.0.3, < 2.0dev",
     "google-resumable-media >= 0.3.1, != 0.4.0, < 0.6.0dev",
     "protobuf >= 3.6.0",
+    "six >=1.13.0,< 2.0.0dev",
 ]
 extras = {
     "bqstorage": [


Test patch: