Skip to content

Commit 1736750

Browse files
refactor code
1 parent d9f0d6f commit 1736750

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

airbyte_cdk/sources/declarative/parsers/manifest_component_transformer.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,11 @@ def _is_json_schema_object(propagated_component: Mapping[str, Any]) -> bool:
200200
]
201201

202202
@staticmethod
203-
def _has_nested_components(propagated_component: Mapping[str, Any]) -> bool:
204-
has_nested_components = False
203+
def _has_nested_components(propagated_component: Dict[str, Any]) -> bool:
205204
for k, v in propagated_component.items():
206205
if isinstance(v, dict) and v.get("type"):
207-
has_nested_components = True
208-
return has_nested_components
206+
return True
207+
return False
209208

210209
def _process_nested_components(
211210
self,
@@ -214,14 +213,14 @@ def _process_nested_components(
214213
current_parameters: Mapping[str, Any],
215214
use_parent_parameters: Optional[bool] = None,
216215
) -> Dict[str, Any]:
217-
for k, v in propagated_component.items():
218-
if isinstance(v, dict) and v.get("type"):
216+
for field_name, field_value in propagated_component.items():
217+
if isinstance(field_value, dict) and field_value.get("type"):
219218
nested_component_with_parameters = self.propagate_types_and_parameters(
220219
parent_field_identifier,
221-
v,
220+
field_value,
222221
current_parameters,
223222
use_parent_parameters=use_parent_parameters,
224223
)
225-
propagated_component[k] = nested_component_with_parameters
224+
propagated_component[field_name] = nested_component_with_parameters
226225

227226
return propagated_component

0 commit comments

Comments
 (0)