Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: sync v3 with main branch #1055

Merged
merged 4 commits into from
Nov 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion google/cloud/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
except ImportError:
import pkgutil

__path__ = pkgutil.extend_path(__path__, __name__)
__path__ = pkgutil.extend_path(__path__, __name__) # type: ignore
4 changes: 2 additions & 2 deletions google/cloud/bigquery/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from typing import Optional, Union

from dateutil import relativedelta
from google.cloud._helpers import UTC
from google.cloud._helpers import UTC # type: ignore
from google.cloud._helpers import _date_from_iso8601_date
from google.cloud._helpers import _datetime_from_microseconds
from google.cloud._helpers import _RFC3339_MICROS
Expand Down Expand Up @@ -93,7 +93,7 @@ def __init__(self):
def installed_version(self) -> packaging.version.Version:
"""Return the parsed version of pyarrow."""
if self._installed_version is None:
import pyarrow
import pyarrow # type: ignore

self._installed_version = packaging.version.parse(
# Use 0.0.0, since it is earlier than any released version.
Expand Down
6 changes: 3 additions & 3 deletions google/cloud/bigquery/_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import os
import pkg_resources

from google.cloud import _http # pytype: disable=import-error
from google.cloud import _http # type: ignore # pytype: disable=import-error
from google.cloud.bigquery import __version__


Expand Down Expand Up @@ -52,8 +52,8 @@ def __init__(self, client, client_info=None, api_endpoint=None):
self._client_info.gapic_version = __version__
self._client_info.client_library_version = __version__

API_VERSION = "v2"
API_VERSION = "v2" # type: ignore
"""The version of the API, used in building the API call's URL."""

API_URL_TEMPLATE = "{api_base_url}/bigquery/{api_version}{path}"
API_URL_TEMPLATE = "{api_base_url}/bigquery/{api_version}{path}" # type: ignore
"""A template for the URL of a particular API call."""
12 changes: 6 additions & 6 deletions google/cloud/bigquery/_pandas_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@
import warnings

try:
import pandas
import pandas # type: ignore
except ImportError: # pragma: NO COVER
pandas = None
else:
import numpy

import pyarrow
import pyarrow.parquet
import pyarrow # type: ignore
import pyarrow.parquet # type: ignore

try:
# _BaseGeometry is used to detect shapely objevys in `bq_to_arrow_array`
from shapely.geometry.base import BaseGeometry as _BaseGeometry
from shapely.geometry.base import BaseGeometry as _BaseGeometry # type: ignore
except ImportError: # pragma: NO COVER
# No shapely, use NoneType for _BaseGeometry as a placeholder.
_BaseGeometry = type(None)
Expand All @@ -47,7 +47,7 @@ def _to_wkb():
# - Avoid extra work done by `shapely.wkb.dumps` that we don't need.
# - Caches the WKBWriter (and write method lookup :) )
# - Avoids adding WKBWriter, lgeos, and notnull to the module namespace.
from shapely.geos import WKBWriter, lgeos
from shapely.geos import WKBWriter, lgeos # type: ignore

write = WKBWriter(lgeos).write
notnull = pandas.notnull
Expand Down Expand Up @@ -593,7 +593,7 @@ def dataframe_to_parquet(

This argument is ignored for ``pyarrow`` versions earlier than ``4.0.0``.
"""
import pyarrow.parquet
import pyarrow.parquet # type: ignore

kwargs = (
{"use_compliant_nested_type": parquet_use_compliant_nested_type}
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/bigquery/_tqdm_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import warnings

try:
import tqdm
import tqdm # type: ignore
except ImportError: # pragma: NO COVER
tqdm = None

Expand Down
Loading