test(langfuse_otel): type the _RecordingSpan and _emitted unit helpers
Some checks failed
LiteLLM Rust / rust-lint (push) Has been cancelled
LiteLLM Rust / rust-test (push) Has been cancelled
LiteLLM Rust / rust-wheel (push) Has been cancelled
Terraform Modules / fmt, validate, test (aws) (push) Has been cancelled
Terraform Modules / fmt, validate, test (gcp) (push) Has been cancelled
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
yucheng 2026-09-26 00:00:21 +00:00
parent 73cc218b2d
commit 06d04ebc63

View file

@ -1,5 +1,7 @@
import json
import os
from collections.abc import Mapping
from typing import Final
from unittest.mock import MagicMock, patch
import pytest
@ -951,15 +953,15 @@ if __name__ == "__main__":
class _RecordingSpan:
def __init__(self):
self.attributes = {}
def __init__(self) -> None:
self.attributes: dict[str, object] = {}
def set_attribute(self, key, value):
def set_attribute(self, key: str, value: object) -> None:
self.attributes[key] = value
def _emitted(kwargs, response_obj=None):
span = _RecordingSpan()
def _emitted(kwargs: Mapping[str, object], response_obj: object = None) -> Mapping[str, object]:
span: Final = _RecordingSpan()
LangfuseOtelLogger._set_langfuse_specific_attributes(span, kwargs, response_obj)
return span.attributes