Skip to content

Commit

Permalink
Add a short comment
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Feb 15, 2024
1 parent 149614e commit 938d15e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions singer_sdk/helpers/_flattening.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,12 @@ def _flatten_record(
items: list[tuple[str, t.Any]] = []
for k, v in record_node.items():
new_key = flatten_key(k, parent_key, separator)
if isinstance(v, collections.abc.MutableMapping) and (
(flattened_schema and new_key not in flattened_schema.get("properties", {}))
# If the value is a dictionary, and the key is not in the schema, and the
# level is less than the max level, then we should continue to flatten.
if (
isinstance(v, collections.abc.MutableMapping)
and flattened_schema
and new_key not in flattened_schema.get("properties", {})
and (level < max_level)
):
items.extend(
Expand Down

0 comments on commit 938d15e

Please sign in to comment.