Skip to content

Commit

Permalink
chore: fix minor typos
Browse files Browse the repository at this point in the history
  • Loading branch information
parthea committed May 21, 2024
1 parent 6264107 commit 94838a8
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion google/cloud/logging_v2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
ASCENDING = "timestamp asc"
"""Query string to order by ascending timestamps."""
DESCENDING = "timestamp desc"
"""Query string to order by decending timestamps."""
"""Query string to order by descending timestamps."""
_instrumentation_emitted = False
"""Flag for whether instrumentation info has been emitted"""

Expand Down
2 changes: 1 addition & 1 deletion google/cloud/logging_v2/_gapic.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def sink_update(
dict: The sink resource returned from the API (converted from a
protobuf to a dictionary).
"""
name = sink_name.split("/")[-1] # parse name out of full resoure name
name = sink_name.split("/")[-1] # parse name out of full resource name
sink_pb = LogSink(
name=name,
filter=filter_,
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/logging_v2/_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def sink_update(
dict: The returned (updated) resource.
"""
target = f"/{sink_name}"
name = sink_name.split("/")[-1] # parse name out of full resoure name
name = sink_name.split("/")[-1] # parse name out of full resource name
data = {"name": name, "filter": filter_, "destination": destination}
query_params = {"uniqueWriterIdentity": unique_writer_identity}
return self.api_request(
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/logging_v2/handlers/transports/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

"""Transport for Python logging handler.
Logs directly to the the Cloud Logging API with a synchronous call.
Logs directly to the Cloud Logging API with a synchronous call.
"""
from google.cloud.logging_v2 import _helpers
from google.cloud.logging_v2.handlers.transports.base import Transport
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/logging_v2/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def __init__(self, logger, client, *, resource=None):
Args:
logger (logging_v2.logger.Logger):
the logger to which entries will be logged.
client (~logging_V2.client.Cilent):
client (~logging_V2.client.Client):
The client to use.
resource (Optional[~logging_v2.resource.Resource]):
Monitored resource of the batch, defaults
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/handlers/test_app_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def test_emit_manual_field_override(self):
setattr(record, "trace", expected_trace)
expected_span = "456"
setattr(record, "span_id", expected_span)
expected_http = {"reuqest_url": "manual"}
expected_http = {"request_url": "manual"}
setattr(record, "http_request", expected_http)
expected_resource = Resource(type="test", labels={})
setattr(record, "resource", expected_resource)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/handlers/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ def test_emit_manual_field_override(self):
setattr(record, "span_id", expected_span)
expected_sampled = True
setattr(record, "trace_sampled", expected_sampled)
expected_http = {"reuqest_url": "manual"}
expected_http = {"request_url": "manual"}
setattr(record, "http_request", expected_http)
expected_source = {"file": "test-file"}
setattr(record, "source_location", expected_source)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/handlers/test_structured_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ def test_format_overrides(self):
"""
Allow users to override log fields using `logging.info("", extra={})`
If supported fields were overriden by the user, those choices should
If supported fields were overridden by the user, those choices should
take precedence.
"""
import logging
Expand Down
14 changes: 7 additions & 7 deletions tests/unit/test__instrumentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class TestInstrumentation(unittest.TestCase):
# LONG_VERSION > 16 characters
LONG_VERSION = TEST_VERSION + "6789ABCDEF12"

def _get_diagonstic_value(self, entry, key):
def _get_diagnostic_value(self, entry, key):
return entry.payload[i._DIAGNOSTIC_INFO_KEY][i._INSTRUMENTATION_SOURCE_KEY][-1][
key
]
Expand All @@ -34,10 +34,10 @@ def test_default_diagnostic_info(self):
entry = i._create_diagnostic_entry()
self.assertEqual(
i._PYTHON_LIBRARY_NAME,
self._get_diagonstic_value(entry, "name"),
self._get_diagnostic_value(entry, "name"),
)
self.assertEqual(
i._LIBRARY_VERSION, self._get_diagonstic_value(entry, "version")
i._LIBRARY_VERSION, self._get_diagnostic_value(entry, "version")
)

def test_custom_diagnostic_info(self):
Expand All @@ -46,10 +46,10 @@ def test_custom_diagnostic_info(self):
)
self.assertEqual(
self.TEST_NAME,
self._get_diagonstic_value(entry, "name"),
self._get_diagnostic_value(entry, "name"),
)
self.assertEqual(
self.TEST_VERSION, self._get_diagonstic_value(entry, "version")
self.TEST_VERSION, self._get_diagnostic_value(entry, "version")
)

def test_truncate_long_values(self):
Expand All @@ -60,8 +60,8 @@ def test_truncate_long_values(self):
expected_name = self.LONG_NAME[: i._MAX_NAME_LENGTH] + "*"
expected_version = self.LONG_VERSION[: i._MAX_VERSION_LENGTH] + "*"

self.assertEqual(expected_name, self._get_diagonstic_value(entry, "name"))
self.assertEqual(expected_version, self._get_diagonstic_value(entry, "version"))
self.assertEqual(expected_name, self._get_diagnostic_value(entry, "name"))
self.assertEqual(expected_version, self._get_diagnostic_value(entry, "version"))

def test_drop_labels(self):
"""Labels should not be copied in instrumentation log"""
Expand Down

0 comments on commit 94838a8

Please sign in to comment.