style(core): fix some noqa escapes (#34675)

Co-authored-by: Mason Daugherty <github@mdrxy.com>
Co-authored-by: Mason Daugherty <mason@langchain.dev>
This commit is contained in:
Christophe Bornet
2026-01-09 23:36:08 +01:00
committed by GitHub
parent fd69425439
commit 8e3c6b109f
25 changed files with 286 additions and 149 deletions

View File

@@ -72,7 +72,7 @@ def _process_dict_properties(
elif isinstance(value, (dict, list)):
# Recursively process nested objects and arrays
result[key] = _dereference_refs_helper(
value, full_schema, processed_refs, skip_keys, shallow_refs
value, full_schema, processed_refs, skip_keys, shallow_refs=shallow_refs
)
else:
# Copy primitive values directly
@@ -85,7 +85,8 @@ def _dereference_refs_helper(
full_schema: dict[str, Any],
processed_refs: set[str] | None,
skip_keys: Sequence[str],
shallow_refs: bool, # noqa: FBT001
*,
shallow_refs: bool,
) -> Any:
"""Dereference JSON Schema $ref objects, handling both pure and mixed references.
@@ -133,7 +134,11 @@ def _dereference_refs_helper(
# Fetch and recursively resolve the referenced object
referenced_object = deepcopy(_retrieve_ref(ref_path, full_schema))
resolved_reference = _dereference_refs_helper(
referenced_object, full_schema, processed_refs, skip_keys, shallow_refs
referenced_object,
full_schema,
processed_refs,
skip_keys,
shallow_refs=shallow_refs,
)
# Clean up: remove from processing set before returning
@@ -171,7 +176,7 @@ def _dereference_refs_helper(
if isinstance(obj, list):
return [
_dereference_refs_helper(
item, full_schema, processed_refs, skip_keys, shallow_refs
item, full_schema, processed_refs, skip_keys, shallow_refs=shallow_refs
)
for item in obj
]
@@ -260,5 +265,8 @@ def dereference_refs(
keys_to_skip = list(skip_keys) if skip_keys is not None else ["$defs"]
shallow = skip_keys is None
return cast(
"dict", _dereference_refs_helper(schema_obj, full, None, keys_to_skip, shallow)
"dict",
_dereference_refs_helper(
schema_obj, full, None, keys_to_skip, shallow_refs=shallow
),
)