Skip to content

Commit ffb898b

Browse files
committed
Reformat with ruff.
1 parent d0f5444 commit ffb898b

File tree

1 file changed

+13
-10
lines changed
  • instrumentation-genai/opentelemetry-instrumentation-google-genai/src/opentelemetry/instrumentation/google_genai

1 file changed

+13
-10
lines changed

instrumentation-genai/opentelemetry-instrumentation-google-genai/src/opentelemetry/instrumentation/google_genai/dict_util.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
import json
17-
from typing import Any, Callable, Dict, Optional, Sequence, Set, Union, Tuple
17+
from typing import Any, Callable, Dict, Optional, Sequence, Set, Tuple, Union
1818

1919
Primitive = Union[bool, str, int, float]
2020
BoolList = list[bool]
@@ -69,21 +69,23 @@ def _flatten_with_flatten_func(
6969
exclude_keys: Set[str],
7070
rename_keys: Dict[str, str],
7171
flatten_functions: Dict[str, Callable],
72-
key_names: Set[str]) -> Tuple[bool, Any]:
72+
key_names: Set[str],
73+
) -> Tuple[bool, Any]:
7374
flatten_func = _get_flatten_func(flatten_functions, key_names)
7475
if flatten_func is None:
7576
return False, value
7677
func_output = flatten_func(
77-
key,
78-
value,
79-
exclude_keys=exclude_keys,
80-
rename_keys=rename_keys,
81-
flatten_functions=flatten_functions,
82-
)
78+
key,
79+
value,
80+
exclude_keys=exclude_keys,
81+
rename_keys=rename_keys,
82+
flatten_functions=flatten_functions,
83+
)
8384
if func_output is None:
8485
return True, {}
8586
if _is_primitive(func_output) or _is_homogenous_primitive_list(
86-
func_output):
87+
func_output
88+
):
8789
return True, {key: func_output}
8890
return False, func_output
8991

@@ -103,7 +105,8 @@ def _flatten_compound_value(
103105
exclude_keys=exclude_keys,
104106
rename_keys=rename_keys,
105107
flatten_functions=flatten_functions,
106-
key_names=key_names)
108+
key_names=key_names,
109+
)
107110
if fully_flattened_with_flatten_func:
108111
return value
109112
if isinstance(value, dict):

0 commit comments

Comments
 (0)