Skip to content

chore: fix typos #487

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

Merged
merged 5 commits into from
Mar 2, 2023
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/api_core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

"""Google API Core.

This package contains common code and utilties used by Google client libraries.
This package contains common code and utilities used by Google client libraries.
"""

from google.api_core import version as api_core_version
Expand Down
2 changes: 1 addition & 1 deletion google/api_core/client_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ClientInfo(object):
``'3.9.6'``.
grpc_version (Optional[str]): The gRPC library version.
api_core_version (str): The google-api-core library version.
gapic_version (Optional[str]): The sversion of gapic-generated client
gapic_version (Optional[str]): The version of gapic-generated client
library, if the library was generated by gapic.
client_library_version (Optional[str]): The version of the client
library, generally used if the client library was not generated
Expand Down
2 changes: 1 addition & 1 deletion google/api_core/datetime_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def to_rfc3339(value, ignore_zone=True):
datetime object is ignored and the datetime is treated as UTC.

Returns:
str: The RFC3339 formated string representing the datetime.
str: The RFC3339 formatted string representing the datetime.
"""
if not ignore_zone and value.tzinfo is not None:
# Convert to UTC and remove the time zone info.
Expand Down
2 changes: 1 addition & 1 deletion google/api_core/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class RetryError(GoogleAPIError):

Args:
message (str): The exception message.
cause (Exception): The last exception raised when retring the
cause (Exception): The last exception raised when retrying the
function.
"""

Expand Down
2 changes: 1 addition & 1 deletion google/api_core/extended_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def __init__(
# optional http_error_code = proto.Field(proto.INT32, number=3)
# optional http_error_msg = proto.Field(proto.STRING, number=4)
#
# the ExtendedOperation subclass would provide property overrrides that map
# the ExtendedOperation subclass would provide property overrides that map
# to these (poorly named) fields.
@property
def name(self):
Expand Down
8 changes: 4 additions & 4 deletions google/api_core/future/polling.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class PollingFuture(base.Future):
The :meth:`done` method should be implemented by subclasses. The polling
behavior will repeatedly call ``done`` until it returns True.

The actuall polling logic is encapsulated in :meth:`result` method. See
The actual polling logic is encapsulated in :meth:`result` method. See
documentation for that method for details on how polling works.

.. note::
Expand All @@ -82,7 +82,7 @@ class PollingFuture(base.Future):
``timeout`` argument is specified in :meth:`result` method it will
override the ``polling.timeout`` property.
retry (google.api_core.retry.Retry): DEPRECATED use ``polling`` instead.
If set, it will override ``polling`` paremeter for backward
If set, it will override ``polling`` parameter for backward
compatibility.
"""

Expand Down Expand Up @@ -224,8 +224,8 @@ class documentation for the proper definition of timeout and deadline
to set this parameter explicitly.

If ``polling`` is provided (i.e. ``polling is not None``), it will be used
to controll the overall polling behavior and ``polling.timeout`` will
controll Polling Timeout unless it is overridden by ``timeout`` parameter
to control the overall polling behavior and ``polling.timeout`` will
control Polling Timeout unless it is overridden by ``timeout`` parameter
as described above. If not provided, the``polling`` parameter specified
during construction of this future (the ``polling`` argument in the
constructor) will be used instead. Note: since the ``timeout`` argument may
Expand Down
2 changes: 1 addition & 1 deletion google/api_core/gapic_v1/client_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ClientInfo(client_info.ClientInfo):
``'3.9.6'``.
grpc_version (Optional[str]): The gRPC library version.
api_core_version (str): The google-api-core library version.
gapic_version (Optional[str]): The sversion of gapic-generated client
gapic_version (Optional[str]): The version of gapic-generated client
library, if the library was generated by gapic.
client_library_version (Optional[str]): The version of the client
library, generally used if the client library was not generated
Expand Down
2 changes: 1 addition & 1 deletion google/api_core/general_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# This import for backward compatibiltiy only.
# This import for backward compatibility only.
from functools import wraps # noqa: F401 pragma: NO COVER
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ def get_operation(
Returns:
google.longrunning.operations_pb2.Operation:
This resource represents a long-
unning operation that is the result of a
running operation that is the result of a
network API call.

"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""gapic configuration for the googe.longrunning.operations client."""
"""gapic configuration for the google.longrunning.operations client."""

# DEPRECATED: retry and timeout classes are instantiated directly
config = {
Expand Down
4 changes: 2 additions & 2 deletions google/api_core/operations_v1/transports/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def __init__(
"https", but for testing or local servers,
"http" can be specified.
http_options: a dictionary of http_options for transcoding, to override
the defaults from operatons.proto. Each method has an entry
the defaults from operations.proto. Each method has an entry
with the corresponding http rules as value.
path_prefix: path prefix (usually represents API version). Set to
"v1" by default.
Expand Down Expand Up @@ -246,7 +246,7 @@ def _get_operation(
Returns:
~.operations_pb2.Operation:
This resource represents a long-
unning operation that is the result of a
running operation that is the result of a
network API call.

"""
Expand Down
4 changes: 2 additions & 2 deletions google/api_core/protobuf_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,10 @@ def field_mask(original, modified):

Args:
original (~google.protobuf.message.Message): the original message.
If set to None, this field will be interpretted as an empty
If set to None, this field will be interpreted as an empty
message.
modified (~google.protobuf.message.Message): the modified message.
If set to None, this field will be interpretted as an empty
If set to None, this field will be interpreted as an empty
message.

Returns:
Expand Down
6 changes: 3 additions & 3 deletions google/api_core/retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

The :class:`Retry` decorator can be used to retry functions that raise
exceptions using exponential backoff. Because a exponential sleep algorithm is
used, the retry is limited by a `deadline`. The deadline is the maxmimum amount
used, the retry is limited by a `deadline`. The deadline is the maximum amount
of time a method can block. This is used instead of total number of retries
because it is difficult to ascertain the amount of time a function can block
when using total number of retries and exponential backoff.
Expand Down Expand Up @@ -265,7 +265,7 @@ class Retry(object):

RPC Timeout: a value supplied by the client to the server so
that the server side knows the maximum amount of time it is expected to
spend handling that specifc RPC. For example, in the case of gRPC transport,
spend handling that specific RPC. For example, in the case of gRPC transport,
RPC Timeout is represented by setting "grpc-timeout" header in the HTTP2
request. The `timeout` property of this class normally never represents the
RPC Timeout as it is handled separately by the ``google.api_core.timeout``
Expand All @@ -285,7 +285,7 @@ class Retry(object):

With the actual timeout types being defined above, the client libraries
often refer to just Timeout without clarifying which type specifically
that is. In that case the actual timeout type (sometimes also refered to as
that is. In that case the actual timeout type (sometimes also referred to as
Logical Timeout) can be determined from the context. If it is a unary rpc
call (i.e. a regular one) Timeout usually stands for the RPC Timeout (if
provided directly as a standalone value) or Retry Timeout (if provided as
Expand Down
6 changes: 3 additions & 3 deletions google/api_core/retry_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class AsyncRetry:
if the given exception is retryable.
initial (float): The minimum a,out of time to delay in seconds. This
must be greater than 0.
maximum (float): The maximum amout of time to delay in seconds.
maximum (float): The maximum amount of time to delay in seconds.
multiplier (float): The multiplier applied to the delay.
timeout (float): How long to keep retrying in seconds.
on_error (Callable[Exception]): A function to call while processing
Expand Down Expand Up @@ -287,9 +287,9 @@ def with_delay(self, initial=None, maximum=None, multiplier=None):
"""Return a copy of this retry with the given delay options.

Args:
initial (float): The minimum amout of time to delay. This must
initial (float): The minimum amount of time to delay. This must
be greater than 0.
maximum (float): The maximum amout of time to delay.
maximum (float): The maximum amount of time to delay.
multiplier (float): The multiplier applied to the delay.

Returns:
Expand Down
6 changes: 3 additions & 3 deletions google/api_core/timeout.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ class ExponentialTimeout(object):
deadline (Optional[float]): The overall deadline across all
invocations. This is used to prevent a very large calculated
timeout from pushing the overall execution time over the deadline.
This is especially useful in conjuction with
This is especially useful in conjunction with
:mod:`google.api_core.retry`. If ``None``, the timeouts will not
be adjusted to accomodate an overall deadline.
be adjusted to accommodate an overall deadline.
"""

def __init__(
Expand All @@ -238,7 +238,7 @@ def __init__(
self._deadline = deadline

def with_deadline(self, deadline):
"""Return a copy of this teimout with the given deadline.
"""Return a copy of this timeout with the given deadline.

Args:
deadline (float): The overall deadline across all invocations.
Expand Down
12 changes: 6 additions & 6 deletions tests/asyncio/test_grpc_helpers_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def test_wrap_errors_streaming(wrap_stream_errors):
@mock.patch(
"google.auth.default",
autospec=True,
return_value=(mock.sentinel.credentials, mock.sentinel.projet),
return_value=(mock.sentinel.credentials, mock.sentinel.project),
)
@mock.patch("grpc.aio.secure_channel")
def test_create_channel_implicit(grpc_secure_channel, default, composite_creds_call):
Expand All @@ -305,7 +305,7 @@ def test_create_channel_implicit(grpc_secure_channel, default, composite_creds_c
@mock.patch(
"google.auth.default",
autospec=True,
return_value=(mock.sentinel.credentials, mock.sentinel.projet),
return_value=(mock.sentinel.credentials, mock.sentinel.project),
)
@mock.patch("grpc.aio.secure_channel")
def test_create_channel_implicit_with_default_host(
Expand All @@ -329,7 +329,7 @@ def test_create_channel_implicit_with_default_host(
@mock.patch("grpc.composite_channel_credentials")
@mock.patch(
"google.auth.default",
return_value=(mock.sentinel.credentials, mock.sentinel.projet),
return_value=(mock.sentinel.credentials, mock.sentinel.project),
)
@mock.patch("grpc.aio.secure_channel")
def test_create_channel_implicit_with_ssl_creds(
Expand All @@ -351,7 +351,7 @@ def test_create_channel_implicit_with_ssl_creds(
@mock.patch(
"google.auth.default",
autospec=True,
return_value=(mock.sentinel.credentials, mock.sentinel.projet),
return_value=(mock.sentinel.credentials, mock.sentinel.project),
)
@mock.patch("grpc.aio.secure_channel")
def test_create_channel_implicit_with_scopes(
Expand All @@ -372,7 +372,7 @@ def test_create_channel_implicit_with_scopes(
@mock.patch(
"google.auth.default",
autospec=True,
return_value=(mock.sentinel.credentials, mock.sentinel.projet),
return_value=(mock.sentinel.credentials, mock.sentinel.project),
)
@mock.patch("grpc.aio.secure_channel")
def test_create_channel_implicit_with_default_scopes(
Expand Down Expand Up @@ -492,7 +492,7 @@ def test_create_channel_explicit_with_quota_project(
autospec=True,
return_value=(mock.sentinel.credentials, mock.sentinel.project),
)
def test_create_channnel_with_credentials_file(
def test_create_channel_with_credentials_file(
load_credentials_from_file, grpc_secure_channel, composite_creds_call
):
target = "example.com:443"
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/gapic/test_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def test_invoke_wrapped_method_with_metadata_as_none():


@mock.patch("time.sleep")
def test_wrap_method_with_default_retry_and_timeout(unusued_sleep):
def test_wrap_method_with_default_retry_and_timeout(unused_sleep):
method = mock.Mock(
spec=["__call__"], side_effect=[exceptions.InternalServerError(None), 42]
)
Expand All @@ -139,7 +139,7 @@ def test_wrap_method_with_default_retry_and_timeout(unusued_sleep):


@mock.patch("time.sleep")
def test_wrap_method_with_default_retry_and_timeout_using_sentinel(unusued_sleep):
def test_wrap_method_with_default_retry_and_timeout_using_sentinel(unused_sleep):
method = mock.Mock(
spec=["__call__"], side_effect=[exceptions.InternalServerError(None), 42]
)
Expand All @@ -160,7 +160,7 @@ def test_wrap_method_with_default_retry_and_timeout_using_sentinel(unusued_sleep


@mock.patch("time.sleep")
def test_wrap_method_with_overriding_retry_and_timeout(unusued_sleep):
def test_wrap_method_with_overriding_retry_and_timeout(unused_sleep):
method = mock.Mock(spec=["__call__"], side_effect=[exceptions.NotFound(None), 42])
default_retry = retry.Retry()
default_timeout = timeout.ConstantTimeout(60)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/operations_v1/test_operations_rest_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ def test_get_operation_rest_failure():
response_value.request = mock_request
req.return_value = response_value
with pytest.raises(core_exceptions.GoogleAPIError):
client.get_operation("sammple0/operations/sample1")
client.get_operation("sample0/operations/sample1")


def test_delete_operation_rest(
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def test_error_details_from_grpc_response():
status.details.append(status_br_detail)
status.details.append(status_ei_detail)

# Actualy error doesn't matter as long as its grpc.Call,
# The actual error doesn't matter as long as its grpc.Call,
# because from_call is mocked.
error = mock.create_autospec(grpc.Call, instance=True)
with mock.patch("grpc_status.rpc_status.from_call") as m:
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/test_grpc_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def test_wrap_stream_prefetch_disabled():
callable_.assert_called_once_with(1, 2, three="four")


def test_wrap_stream_iterable_iterface():
def test_wrap_stream_iterable_interface():
response_iter = mock.create_autospec(grpc.Call, instance=True)
callable_ = mock.Mock(spec=["__call__"], return_value=response_iter)

Expand Down Expand Up @@ -352,7 +352,7 @@ def test_wrap_errors_streaming(wrap_stream_errors):
@mock.patch(
"google.auth.default",
autospec=True,
return_value=(mock.sentinel.credentials, mock.sentinel.projet),
return_value=(mock.sentinel.credentials, mock.sentinel.project),
)
@mock.patch("grpc.secure_channel")
def test_create_channel_implicit(grpc_secure_channel, default, composite_creds_call):
Expand Down Expand Up @@ -410,7 +410,7 @@ def test_create_channel_implicit_with_default_host(
@mock.patch(
"google.auth.default",
autospec=True,
return_value=(mock.sentinel.credentials, mock.sentinel.projet),
return_value=(mock.sentinel.credentials, mock.sentinel.project),
)
@mock.patch("grpc.secure_channel")
def test_create_channel_implicit_with_ssl_creds(
Expand All @@ -437,7 +437,7 @@ def test_create_channel_implicit_with_ssl_creds(
@mock.patch(
"google.auth.default",
autospec=True,
return_value=(mock.sentinel.credentials, mock.sentinel.projet),
return_value=(mock.sentinel.credentials, mock.sentinel.project),
)
@mock.patch("grpc.secure_channel")
def test_create_channel_implicit_with_scopes(
Expand All @@ -462,7 +462,7 @@ def test_create_channel_implicit_with_scopes(
@mock.patch(
"google.auth.default",
autospec=True,
return_value=(mock.sentinel.credentials, mock.sentinel.projet),
return_value=(mock.sentinel.credentials, mock.sentinel.project),
)
@mock.patch("grpc.secure_channel")
def test_create_channel_implicit_with_default_scopes(
Expand Down