Skip to content

Commit 7da0e8c

Browse files
committed
Switch pyright: to type:
1 parent 357f191 commit 7da0e8c

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/_log_exporter/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def _translate_data(
109109
) -> ExportLogsServiceRequest:
110110
return encode_logs(data)
111111

112-
def export( # pyright: ignore [reportIncompatibleMethodOverride]
112+
def export( # type: ignore [reportIncompatibleMethodOverride]
113113
self,
114114
batch: Sequence[LogData],
115115
) -> Literal[LogExportResult.SUCCESS, LogExportResult.FAILURE]:

exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ def __init__(
304304
self._channel = secure_channel(
305305
self._endpoint, credentials, compression=compression
306306
)
307-
self._client = self._stub(self._channel) # pyright: ignore [reportCallIssue]
307+
self._client = self._stub(self._channel) # type: ignore [reportCallIssue]
308308

309309
self._export_lock = threading.Lock()
310310
self._shutdown = False
@@ -324,7 +324,7 @@ def _export(
324324
# not allowed and should return a Failure result.
325325
if self._shutdown:
326326
logger.warning("Exporter already shutdown, ignoring batch")
327-
return self._result.FAILURE # pyright: ignore [reportReturnType]
327+
return self._result.FAILURE # type: ignore [reportReturnType]
328328

329329
# FIXME remove this check if the export type for traces
330330
# gets updated to a class that represents the proto
@@ -342,7 +342,7 @@ def _export(
342342
max_value=self._MAX_RETRY_TIMEOUT
343343
):
344344
if delay == self._MAX_RETRY_TIMEOUT or self._shutdown:
345-
return self._result.FAILURE # pyright: ignore [reportReturnType]
345+
return self._result.FAILURE # type: ignore [reportReturnType]
346346

347347
with self._export_lock:
348348
try:
@@ -352,10 +352,10 @@ def _export(
352352
timeout=self._timeout,
353353
)
354354

355-
return self._result.SUCCESS # pyright: ignore [reportReturnType]
355+
return self._result.SUCCESS # type: ignore [reportReturnType]
356356

357357
except RpcError as error:
358-
code = error.code() # pyright: ignore [reportAttributeAccessIssue]
358+
code = error.code() # type: ignore [reportAttributeAccessIssue]
359359
if code in [
360360
StatusCode.CANCELLED,
361361
StatusCode.DEADLINE_EXCEEDED,
@@ -365,7 +365,7 @@ def _export(
365365
StatusCode.UNAVAILABLE,
366366
StatusCode.DATA_LOSS,
367367
]:
368-
retry_info_bin = dict(error.trailing_metadata()).get( # pyright: ignore [reportAttributeAccessIssue]
368+
retry_info_bin = dict(error.trailing_metadata()).get( # type: ignore [reportAttributeAccessIssue]
369369
"google.rpc.retryinfo-bin"
370370
)
371371
if retry_info_bin is not None:
@@ -398,11 +398,11 @@ def _export(
398398
)
399399

400400
if code == StatusCode.OK:
401-
return self._result.SUCCESS # pyright: ignore [reportReturnType]
401+
return self._result.SUCCESS # type: ignore [reportReturnType]
402402

403-
return self._result.FAILURE # pyright: ignore [reportReturnType]
403+
return self._result.FAILURE # type: ignore [reportReturnType]
404404

405-
return self._result.FAILURE # pyright: ignore [reportReturnType]
405+
return self._result.FAILURE # type: ignore [reportReturnType]
406406

407407
def shutdown(self, timeout_millis: float = 30_000, **kwargs) -> None:
408408
if self._shutdown:

exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/metric_exporter/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def __init__(
153153

154154
self._max_export_batch_size: int | None = max_export_batch_size
155155

156-
def _translate_data( # pyright: ignore [reportIncompatibleMethodOverride]
156+
def _translate_data( # type: ignore [reportIncompatibleMethodOverride]
157157
self, data: MetricsData
158158
) -> ExportMetricsServiceRequest:
159159
return encode_metrics(data)

0 commit comments

Comments
 (0)