Skip to content
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 packages/google-api-core/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import os
import shlex
import sys

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down
3 changes: 1 addition & 2 deletions packages/google-api-core/google/api_core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
This package contains common code and utilities used by Google client libraries.
"""

from google.api_core import _python_package_support
from google.api_core import _python_version_support
from google.api_core import _python_package_support, _python_version_support
from google.api_core import version as api_core_version

__version__ = api_core_version.__version__
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,15 @@
"""Code to check versions of dependencies used by Google Cloud Client Libraries."""

import warnings
from typing import Optional, Tuple

from collections import namedtuple
from importlib import metadata
from typing import Optional, Tuple

from ._python_version_support import (
_flatten_message,
_get_distribution_and_import_packages,
)

from importlib import metadata

ParsedVersion = Tuple[int, ...]

# Here we list all the packages for which we want to issue warnings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@
import datetime
import enum
import functools
from importlib import metadata
import logging
import warnings
import sys
import textwrap
from typing import Any, List, NamedTuple, Optional, Dict, Tuple

import warnings
from importlib import metadata
from typing import Any, Dict, List, NamedTuple, Optional, Tuple

_LOGGER = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@

"""Helpers for server-side streaming in REST."""

from collections import deque
import string
from typing import Deque, Union
import types
from collections import deque
from typing import Deque, Union

import proto
import google.protobuf.message
import proto
from google.protobuf.json_format import Parse


Expand Down
2 changes: 1 addition & 1 deletion packages/google-api-core/google/api_core/bidi.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def __iter__(self):
except queue_module.Empty:
if not self._is_active():
_LOGGER.debug(
"Empty queue and inactive call, exiting request " "generator."
"Empty queue and inactive call, exiting request generator."
)
return
else:
Expand Down
4 changes: 1 addition & 3 deletions packages/google-api-core/google/api_core/bidi_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@
import logging
from typing import Callable, Optional, Union

from google.protobuf.message import Message as ProtobufMessage
from grpc import aio

from google.api_core import exceptions
from google.api_core.bidi_base import BidiRpcBase

from google.protobuf.message import Message as ProtobufMessage


_LOGGER = logging.getLogger(__name__)


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import logging
import json
import logging
import os

from typing import List, Optional

_LOGGING_INITIALIZED = False
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def get_client_cert():
"""

from typing import Callable, Mapping, Optional, Sequence, Tuple
import warnings
from typing import Callable, Mapping, Optional, Sequence, Tuple

from google.api_core import general_helpers

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

from google.protobuf import timestamp_pb2


_UTC_EPOCH = datetime.datetime(1970, 1, 1, tzinfo=datetime.timezone.utc)
_RFC3339_MICROS = "%Y-%m-%dT%H:%M:%S.%fZ"
_RFC3339_NO_FRACTION = "%Y-%m-%dT%H:%M:%S"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import logging
import threading


_LOGGER = logging.getLogger(__name__)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@

import asyncio

from google.api_core import exceptions
from google.api_core import retry
from google.api_core import retry_async
from google.api_core import exceptions, retry, retry_async
from google.api_core.future import base


Expand Down Expand Up @@ -101,7 +99,7 @@ async def _blocking_poll(self, timeout=None):
await retry_(self._done_or_raise)()
except exceptions.RetryError:
raise asyncio.TimeoutError(
"Operation did not complete within the designated " "timeout."
"Operation did not complete within the designated timeout."
)

async def result(self, timeout=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@

from google.api_core import exceptions
from google.api_core import retry as retries
from google.api_core.future import _helpers
from google.api_core.future import base
from google.api_core.future import _helpers, base


class _OperationNotComplete(Exception):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

from google.api_core import client_info


METRICS_METADATA_KEY = "x-goog-api-client"


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@

import grpc

from google.api_core import exceptions
from google.api_core import retry
from google.api_core import timeout

from google.api_core import exceptions, retry, timeout

_MILLIS_PER_SECOND = 1000.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@

from google.api_core import grpc_helpers_async
from google.api_core.gapic_v1 import client_info
from google.api_core.gapic_v1.method import _GapicCallable
from google.api_core.gapic_v1.method import DEFAULT # noqa: F401
from google.api_core.gapic_v1.method import USE_DEFAULT_METADATA # noqa: F401
from google.api_core.gapic_v1.method import ( # noqa: F401
DEFAULT,
USE_DEFAULT_METADATA,
_GapicCallable,
)

_DEFAULT_ASYNC_TRANSPORT_KIND = "grpc_asyncio"

Expand Down
4 changes: 2 additions & 2 deletions packages/google-api-core/google/api_core/grpc_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
# limitations under the License.

"""Helpers for :mod:`grpc`."""

import collections
import functools
from typing import Generic, Iterator, Optional, TypeVar
import warnings
from typing import Generic, Iterator, Optional, TypeVar

import google.auth
import google.auth.credentials
Expand All @@ -27,7 +28,6 @@

from google.api_core import exceptions, general_helpers


# The list of gRPC Callable interfaces that return iterators.
_STREAM_WRAP_CLASSES = (grpc.UnaryStreamMultiCallable, grpc.StreamStreamMultiCallable)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import asyncio
import functools
import warnings

from typing import AsyncGenerator, Generic, Iterator, Optional, TypeVar

import grpc
Expand Down
6 changes: 3 additions & 3 deletions packages/google-api-core/google/api_core/operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ def my_callback(future):
import functools
import threading

from google.api_core import exceptions
from google.api_core import protobuf_helpers
from google.api_core.future import polling
from google.longrunning import operations_pb2
from google.protobuf import json_format
from google.rpc import code_pb2

from google.api_core import exceptions, protobuf_helpers
from google.api_core.future import polling


class Operation(polling.PollingFuture):
"""A Future for interacting with a Google API Long-Running Operation.
Expand Down
6 changes: 3 additions & 3 deletions packages/google-api-core/google/api_core/operation_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ def my_callback(future):
import functools
import threading

from google.api_core import exceptions
from google.api_core import protobuf_helpers
from google.api_core.future import async_future
from google.longrunning import operations_pb2
from google.rpc import code_pb2

from google.api_core import exceptions, protobuf_helpers
from google.api_core.future import async_future


class AsyncOperation(async_future.AsyncFuture):
"""A Future for interacting with a Google API Long-Running Operation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@
# On Python 3.15+, PEP 0810 lazy loading means these imports will succeed
# instantly (returning a lazy proxy). Any actual ImportErrors (e.g., due to
# missing aiohttp/auth dependencies) are deferred until the proxies are accessed.
from google.api_core.operations_v1.transports.rest_asyncio import ( # noqa: E402, F401
AsyncOperationsRestTransport,
)
from google.api_core.operations_v1.operations_rest_client_async import ( # noqa: E402, F401
AsyncOperationsRestClient,
)
from google.api_core.operations_v1.transports.rest_asyncio import ( # noqa: E402, F401
AsyncOperationsRestTransport,
)

__all__.extend(["AsyncOperationsRestClient", "AsyncOperationsRestTransport"])
except ImportError:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from collections import OrderedDict
import os
import re
from collections import OrderedDict
from typing import Dict, Optional, Type, Union

from google.api_core import client_options as client_options_lib # type: ignore
Expand Down Expand Up @@ -358,8 +358,7 @@ def __init__(
)
if client_options.scopes:
raise ValueError(
"When providing a transport instance, provide its scopes "
"directly."
"When providing a transport instance, provide its scopes directly."
)
self._transport = transport
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,22 @@
#
from typing import Optional, Sequence, Tuple, Union

import grpc
from google.auth import credentials as ga_credentials # type: ignore
from google.longrunning import operations_pb2
from google.oauth2 import service_account # type: ignore

from google.api_core import client_options as client_options_lib # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.api_core.operations_v1 import pagers
from google.api_core.operations_v1.abstract_operations_base_client import (
AbstractOperationsBaseClient,
)
from google.api_core.operations_v1.transports.base import (
DEFAULT_CLIENT_INFO,
OperationsTransport,
)
from google.api_core.operations_v1.abstract_operations_base_client import (
AbstractOperationsBaseClient,
)
from google.auth import credentials as ga_credentials # type: ignore
from google.longrunning import operations_pb2
from google.oauth2 import service_account # type: ignore
import grpc

OptionalRetry = Union[retries.Retry, object]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@

import functools

from google.longrunning import operations_pb2
from grpc import Compression

from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1, page_iterator_async
from google.api_core import retry_async as retries
from google.api_core import timeout as timeouts
from google.longrunning import operations_pb2
from grpc import Compression


class OperationsAsyncClient:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@

import functools

from google.longrunning import operations_pb2
from grpc import Compression

from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import page_iterator
from google.api_core import gapic_v1, page_iterator
from google.api_core import retry as retries
from google.api_core import timeout as timeouts
from google.longrunning import operations_pb2
from grpc import Compression


class OperationsClient(object):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,18 @@
#
from typing import Optional, Sequence, Tuple, Union

from google.longrunning import operations_pb2

from google.api_core import client_options as client_options_lib # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core.operations_v1 import pagers_async as pagers
from google.api_core.operations_v1.abstract_operations_base_client import (
AbstractOperationsBaseClient,
)
from google.api_core.operations_v1.transports.base import (
DEFAULT_CLIENT_INFO,
OperationsTransport,
)
from google.api_core.operations_v1.abstract_operations_base_client import (
AbstractOperationsBaseClient,
)
from google.longrunning import operations_pb2

try:
from google.auth.aio import credentials as ga_credentials # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
)

from google.longrunning import operations_pb2

from google.api_core.operations_v1.pagers_base import ListOperationsPagerBase


Expand Down
Loading
Loading