Skip to content

Commit bf10796

Browse files
committed
Fix CI
Signed-off-by: Israel Blancas <[email protected]>
1 parent a4c169c commit bf10796

File tree

2 files changed

+19
-8
lines changed
  • opentelemetry-api/src/opentelemetry/_logs/_internal
  • opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal

2 files changed

+19
-8
lines changed

opentelemetry-api/src/opentelemetry/_logs/_internal/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ def emit(
167167
def emit(
168168
self,
169169
record: LogRecord,
170+
*,
171+
exception: BaseException | None = None,
170172
) -> None: ...
171173

172174
@abstractmethod
@@ -212,6 +214,8 @@ def emit(
212214
def emit( # pylint:disable=arguments-differ
213215
self,
214216
record: LogRecord,
217+
*,
218+
exception: BaseException | None = None,
215219
) -> None: ...
216220

217221
def emit(
@@ -280,6 +284,8 @@ def emit(
280284
def emit( # pylint:disable=arguments-differ
281285
self,
282286
record: LogRecord,
287+
*,
288+
exception: BaseException | None = None,
283289
) -> None: ...
284290

285291
def emit(

opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -544,22 +544,27 @@ def _get_attributes_with_exception(
544544
return attributes
545545

546546
exception_attributes_map = _get_exception_attributes(exception)
547-
attributes = attributes or {}
548-
if isinstance(attributes, BoundedAttributes):
547+
if attributes is None:
548+
attributes_map: _ExtendedAttributes = {}
549+
else:
550+
attributes_map = attributes
551+
552+
if isinstance(attributes_map, BoundedAttributes):
553+
bounded_attributes = attributes_map
549554
merged = BoundedAttributes(
550-
maxlen=attributes.maxlen,
551-
attributes=attributes,
555+
maxlen=bounded_attributes.maxlen,
556+
attributes=bounded_attributes,
552557
immutable=False,
553-
max_value_len=attributes.max_value_len,
554-
extended_attributes=attributes._extended_attributes, # pylint: disable=protected-access
558+
max_value_len=bounded_attributes.max_value_len,
559+
extended_attributes=bounded_attributes._extended_attributes, # pylint: disable=protected-access
555560
)
556-
merged.dropped = attributes.dropped
561+
merged.dropped = bounded_attributes.dropped
557562
for key, value in exception_attributes_map.items():
558563
if key not in merged:
559564
merged[key] = value
560565
return merged
561566

562-
return exception_attributes_map | dict(attributes)
567+
return exception_attributes_map | dict(attributes_map.items())
563568

564569

565570
def _copy_log_record(

0 commit comments

Comments
 (0)