Skip to content

Commit 2a6a36b

Browse files
authored
chore: fix typos (#487)
* chore: fix typos * more typos * address review feedback * grammar
1 parent 06d66cc commit 2a6a36b

20 files changed

+42
-42
lines changed

google/api_core/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
"""Google API Core.
1616
17-
This package contains common code and utilties used by Google client libraries.
17+
This package contains common code and utilities used by Google client libraries.
1818
"""
1919

2020
from google.api_core import version as api_core_version

google/api_core/client_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class ClientInfo(object):
4848
``'3.9.6'``.
4949
grpc_version (Optional[str]): The gRPC library version.
5050
api_core_version (str): The google-api-core library version.
51-
gapic_version (Optional[str]): The sversion of gapic-generated client
51+
gapic_version (Optional[str]): The version of gapic-generated client
5252
library, if the library was generated by gapic.
5353
client_library_version (Optional[str]): The version of the client
5454
library, generally used if the client library was not generated

google/api_core/datetime_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def to_rfc3339(value, ignore_zone=True):
170170
datetime object is ignored and the datetime is treated as UTC.
171171
172172
Returns:
173-
str: The RFC3339 formated string representing the datetime.
173+
str: The RFC3339 formatted string representing the datetime.
174174
"""
175175
if not ignore_zone and value.tzinfo is not None:
176176
# Convert to UTC and remove the time zone info.

google/api_core/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class RetryError(GoogleAPIError):
7373
7474
Args:
7575
message (str): The exception message.
76-
cause (Exception): The last exception raised when retring the
76+
cause (Exception): The last exception raised when retrying the
7777
function.
7878
"""
7979

google/api_core/extended_operation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def __init__(
101101
# optional http_error_code = proto.Field(proto.INT32, number=3)
102102
# optional http_error_msg = proto.Field(proto.STRING, number=4)
103103
#
104-
# the ExtendedOperation subclass would provide property overrrides that map
104+
# the ExtendedOperation subclass would provide property overrides that map
105105
# to these (poorly named) fields.
106106
@property
107107
def name(self):

google/api_core/future/polling.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class PollingFuture(base.Future):
6868
The :meth:`done` method should be implemented by subclasses. The polling
6969
behavior will repeatedly call ``done`` until it returns True.
7070
71-
The actuall polling logic is encapsulated in :meth:`result` method. See
71+
The actual polling logic is encapsulated in :meth:`result` method. See
7272
documentation for that method for details on how polling works.
7373
7474
.. note::
@@ -82,7 +82,7 @@ class PollingFuture(base.Future):
8282
``timeout`` argument is specified in :meth:`result` method it will
8383
override the ``polling.timeout`` property.
8484
retry (google.api_core.retry.Retry): DEPRECATED use ``polling`` instead.
85-
If set, it will override ``polling`` paremeter for backward
85+
If set, it will override ``polling`` parameter for backward
8686
compatibility.
8787
"""
8888

@@ -224,8 +224,8 @@ class documentation for the proper definition of timeout and deadline
224224
to set this parameter explicitly.
225225
226226
If ``polling`` is provided (i.e. ``polling is not None``), it will be used
227-
to controll the overall polling behavior and ``polling.timeout`` will
228-
controll Polling Timeout unless it is overridden by ``timeout`` parameter
227+
to control the overall polling behavior and ``polling.timeout`` will
228+
control Polling Timeout unless it is overridden by ``timeout`` parameter
229229
as described above. If not provided, the``polling`` parameter specified
230230
during construction of this future (the ``polling`` argument in the
231231
constructor) will be used instead. Note: since the ``timeout`` argument may

google/api_core/gapic_v1/client_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class ClientInfo(client_info.ClientInfo):
3636
``'3.9.6'``.
3737
grpc_version (Optional[str]): The gRPC library version.
3838
api_core_version (str): The google-api-core library version.
39-
gapic_version (Optional[str]): The sversion of gapic-generated client
39+
gapic_version (Optional[str]): The version of gapic-generated client
4040
library, if the library was generated by gapic.
4141
client_library_version (Optional[str]): The version of the client
4242
library, generally used if the client library was not generated

google/api_core/general_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
# This import for backward compatibiltiy only.
15+
# This import for backward compatibility only.
1616
from functools import wraps # noqa: F401 pragma: NO COVER

google/api_core/operations_v1/abstract_operations_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ def get_operation(
468468
Returns:
469469
google.longrunning.operations_pb2.Operation:
470470
This resource represents a long-
471-
unning operation that is the result of a
471+
running operation that is the result of a
472472
network API call.
473473
474474
"""

google/api_core/operations_v1/operations_client_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""gapic configuration for the googe.longrunning.operations client."""
15+
"""gapic configuration for the google.longrunning.operations client."""
1616

1717
# DEPRECATED: retry and timeout classes are instantiated directly
1818
config = {

google/api_core/operations_v1/transports/rest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def __init__(
108108
"https", but for testing or local servers,
109109
"http" can be specified.
110110
http_options: a dictionary of http_options for transcoding, to override
111-
the defaults from operatons.proto. Each method has an entry
111+
the defaults from operations.proto. Each method has an entry
112112
with the corresponding http rules as value.
113113
path_prefix: path prefix (usually represents API version). Set to
114114
"v1" by default.
@@ -246,7 +246,7 @@ def _get_operation(
246246
Returns:
247247
~.operations_pb2.Operation:
248248
This resource represents a long-
249-
unning operation that is the result of a
249+
running operation that is the result of a
250250
network API call.
251251
252252
"""

google/api_core/protobuf_helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,10 @@ def field_mask(original, modified):
288288
289289
Args:
290290
original (~google.protobuf.message.Message): the original message.
291-
If set to None, this field will be interpretted as an empty
291+
If set to None, this field will be interpreted as an empty
292292
message.
293293
modified (~google.protobuf.message.Message): the modified message.
294-
If set to None, this field will be interpretted as an empty
294+
If set to None, this field will be interpreted as an empty
295295
message.
296296
297297
Returns:

google/api_core/retry.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
1717
The :class:`Retry` decorator can be used to retry functions that raise
1818
exceptions using exponential backoff. Because a exponential sleep algorithm is
19-
used, the retry is limited by a `deadline`. The deadline is the maxmimum amount
19+
used, the retry is limited by a `deadline`. The deadline is the maximum amount
2020
of time a method can block. This is used instead of total number of retries
2121
because it is difficult to ascertain the amount of time a function can block
2222
when using total number of retries and exponential backoff.
@@ -265,7 +265,7 @@ class Retry(object):
265265
266266
RPC Timeout: a value supplied by the client to the server so
267267
that the server side knows the maximum amount of time it is expected to
268-
spend handling that specifc RPC. For example, in the case of gRPC transport,
268+
spend handling that specific RPC. For example, in the case of gRPC transport,
269269
RPC Timeout is represented by setting "grpc-timeout" header in the HTTP2
270270
request. The `timeout` property of this class normally never represents the
271271
RPC Timeout as it is handled separately by the ``google.api_core.timeout``
@@ -285,7 +285,7 @@ class Retry(object):
285285
286286
With the actual timeout types being defined above, the client libraries
287287
often refer to just Timeout without clarifying which type specifically
288-
that is. In that case the actual timeout type (sometimes also refered to as
288+
that is. In that case the actual timeout type (sometimes also referred to as
289289
Logical Timeout) can be determined from the context. If it is a unary rpc
290290
call (i.e. a regular one) Timeout usually stands for the RPC Timeout (if
291291
provided directly as a standalone value) or Retry Timeout (if provided as

google/api_core/retry_async.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ class AsyncRetry:
169169
if the given exception is retryable.
170170
initial (float): The minimum a,out of time to delay in seconds. This
171171
must be greater than 0.
172-
maximum (float): The maximum amout of time to delay in seconds.
172+
maximum (float): The maximum amount of time to delay in seconds.
173173
multiplier (float): The multiplier applied to the delay.
174174
timeout (float): How long to keep retrying in seconds.
175175
on_error (Callable[Exception]): A function to call while processing
@@ -287,9 +287,9 @@ def with_delay(self, initial=None, maximum=None, multiplier=None):
287287
"""Return a copy of this retry with the given delay options.
288288
289289
Args:
290-
initial (float): The minimum amout of time to delay. This must
290+
initial (float): The minimum amount of time to delay. This must
291291
be greater than 0.
292-
maximum (float): The maximum amout of time to delay.
292+
maximum (float): The maximum amount of time to delay.
293293
multiplier (float): The multiplier applied to the delay.
294294
295295
Returns:

google/api_core/timeout.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,9 @@ class ExponentialTimeout(object):
220220
deadline (Optional[float]): The overall deadline across all
221221
invocations. This is used to prevent a very large calculated
222222
timeout from pushing the overall execution time over the deadline.
223-
This is especially useful in conjuction with
223+
This is especially useful in conjunction with
224224
:mod:`google.api_core.retry`. If ``None``, the timeouts will not
225-
be adjusted to accomodate an overall deadline.
225+
be adjusted to accommodate an overall deadline.
226226
"""
227227

228228
def __init__(
@@ -238,7 +238,7 @@ def __init__(
238238
self._deadline = deadline
239239

240240
def with_deadline(self, deadline):
241-
"""Return a copy of this teimout with the given deadline.
241+
"""Return a copy of this timeout with the given deadline.
242242
243243
Args:
244244
deadline (float): The overall deadline across all invocations.

tests/asyncio/test_grpc_helpers_async.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ def test_wrap_errors_streaming(wrap_stream_errors):
280280
@mock.patch(
281281
"google.auth.default",
282282
autospec=True,
283-
return_value=(mock.sentinel.credentials, mock.sentinel.projet),
283+
return_value=(mock.sentinel.credentials, mock.sentinel.project),
284284
)
285285
@mock.patch("grpc.aio.secure_channel")
286286
def test_create_channel_implicit(grpc_secure_channel, default, composite_creds_call):
@@ -305,7 +305,7 @@ def test_create_channel_implicit(grpc_secure_channel, default, composite_creds_c
305305
@mock.patch(
306306
"google.auth.default",
307307
autospec=True,
308-
return_value=(mock.sentinel.credentials, mock.sentinel.projet),
308+
return_value=(mock.sentinel.credentials, mock.sentinel.project),
309309
)
310310
@mock.patch("grpc.aio.secure_channel")
311311
def test_create_channel_implicit_with_default_host(
@@ -329,7 +329,7 @@ def test_create_channel_implicit_with_default_host(
329329
@mock.patch("grpc.composite_channel_credentials")
330330
@mock.patch(
331331
"google.auth.default",
332-
return_value=(mock.sentinel.credentials, mock.sentinel.projet),
332+
return_value=(mock.sentinel.credentials, mock.sentinel.project),
333333
)
334334
@mock.patch("grpc.aio.secure_channel")
335335
def test_create_channel_implicit_with_ssl_creds(
@@ -351,7 +351,7 @@ def test_create_channel_implicit_with_ssl_creds(
351351
@mock.patch(
352352
"google.auth.default",
353353
autospec=True,
354-
return_value=(mock.sentinel.credentials, mock.sentinel.projet),
354+
return_value=(mock.sentinel.credentials, mock.sentinel.project),
355355
)
356356
@mock.patch("grpc.aio.secure_channel")
357357
def test_create_channel_implicit_with_scopes(
@@ -372,7 +372,7 @@ def test_create_channel_implicit_with_scopes(
372372
@mock.patch(
373373
"google.auth.default",
374374
autospec=True,
375-
return_value=(mock.sentinel.credentials, mock.sentinel.projet),
375+
return_value=(mock.sentinel.credentials, mock.sentinel.project),
376376
)
377377
@mock.patch("grpc.aio.secure_channel")
378378
def test_create_channel_implicit_with_default_scopes(
@@ -492,7 +492,7 @@ def test_create_channel_explicit_with_quota_project(
492492
autospec=True,
493493
return_value=(mock.sentinel.credentials, mock.sentinel.project),
494494
)
495-
def test_create_channnel_with_credentials_file(
495+
def test_create_channel_with_credentials_file(
496496
load_credentials_from_file, grpc_secure_channel, composite_creds_call
497497
):
498498
target = "example.com:443"

tests/unit/gapic/test_method.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def test_invoke_wrapped_method_with_metadata_as_none():
121121

122122

123123
@mock.patch("time.sleep")
124-
def test_wrap_method_with_default_retry_and_timeout(unusued_sleep):
124+
def test_wrap_method_with_default_retry_and_timeout(unused_sleep):
125125
method = mock.Mock(
126126
spec=["__call__"], side_effect=[exceptions.InternalServerError(None), 42]
127127
)
@@ -139,7 +139,7 @@ def test_wrap_method_with_default_retry_and_timeout(unusued_sleep):
139139

140140

141141
@mock.patch("time.sleep")
142-
def test_wrap_method_with_default_retry_and_timeout_using_sentinel(unusued_sleep):
142+
def test_wrap_method_with_default_retry_and_timeout_using_sentinel(unused_sleep):
143143
method = mock.Mock(
144144
spec=["__call__"], side_effect=[exceptions.InternalServerError(None), 42]
145145
)
@@ -160,7 +160,7 @@ def test_wrap_method_with_default_retry_and_timeout_using_sentinel(unusued_sleep
160160

161161

162162
@mock.patch("time.sleep")
163-
def test_wrap_method_with_overriding_retry_and_timeout(unusued_sleep):
163+
def test_wrap_method_with_overriding_retry_and_timeout(unused_sleep):
164164
method = mock.Mock(spec=["__call__"], side_effect=[exceptions.NotFound(None), 42])
165165
default_retry = retry.Retry()
166166
default_timeout = timeout.ConstantTimeout(60)

tests/unit/operations_v1/test_operations_rest_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ def test_get_operation_rest_failure():
592592
response_value.request = mock_request
593593
req.return_value = response_value
594594
with pytest.raises(core_exceptions.GoogleAPIError):
595-
client.get_operation("sammple0/operations/sample1")
595+
client.get_operation("sample0/operations/sample1")
596596

597597

598598
def test_delete_operation_rest(

tests/unit/test_exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ def test_error_details_from_grpc_response():
355355
status.details.append(status_br_detail)
356356
status.details.append(status_ei_detail)
357357

358-
# Actualy error doesn't matter as long as its grpc.Call,
358+
# The actual error doesn't matter as long as its grpc.Call,
359359
# because from_call is mocked.
360360
error = mock.create_autospec(grpc.Call, instance=True)
361361
with mock.patch("grpc_status.rpc_status.from_call") as m:

tests/unit/test_grpc_helpers.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def test_wrap_stream_prefetch_disabled():
222222
callable_.assert_called_once_with(1, 2, three="four")
223223

224224

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

@@ -352,7 +352,7 @@ def test_wrap_errors_streaming(wrap_stream_errors):
352352
@mock.patch(
353353
"google.auth.default",
354354
autospec=True,
355-
return_value=(mock.sentinel.credentials, mock.sentinel.projet),
355+
return_value=(mock.sentinel.credentials, mock.sentinel.project),
356356
)
357357
@mock.patch("grpc.secure_channel")
358358
def test_create_channel_implicit(grpc_secure_channel, default, composite_creds_call):
@@ -410,7 +410,7 @@ def test_create_channel_implicit_with_default_host(
410410
@mock.patch(
411411
"google.auth.default",
412412
autospec=True,
413-
return_value=(mock.sentinel.credentials, mock.sentinel.projet),
413+
return_value=(mock.sentinel.credentials, mock.sentinel.project),
414414
)
415415
@mock.patch("grpc.secure_channel")
416416
def test_create_channel_implicit_with_ssl_creds(
@@ -437,7 +437,7 @@ def test_create_channel_implicit_with_ssl_creds(
437437
@mock.patch(
438438
"google.auth.default",
439439
autospec=True,
440-
return_value=(mock.sentinel.credentials, mock.sentinel.projet),
440+
return_value=(mock.sentinel.credentials, mock.sentinel.project),
441441
)
442442
@mock.patch("grpc.secure_channel")
443443
def test_create_channel_implicit_with_scopes(
@@ -462,7 +462,7 @@ def test_create_channel_implicit_with_scopes(
462462
@mock.patch(
463463
"google.auth.default",
464464
autospec=True,
465-
return_value=(mock.sentinel.credentials, mock.sentinel.projet),
465+
return_value=(mock.sentinel.credentials, mock.sentinel.project),
466466
)
467467
@mock.patch("grpc.secure_channel")
468468
def test_create_channel_implicit_with_default_scopes(

0 commit comments

Comments
 (0)