Skip to content

Commit 26095cb

Browse files
author
octavia-squidington-iii
committed
Auto-fix lint and format issues
1 parent af400e5 commit 26095cb

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

airbyte_cdk/sources/declarative/partition_routers/substream_partition_router.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,11 @@ def _migrate_child_state_to_parent_state(self, stream_state: StreamState) -> Str
374374
# Ignore per-partition states or invalid formats.
375375
if isinstance(substream_state, (list, dict)) or len(substream_state_values) != 1:
376376
# If a global state is present under the key "state", use its first value.
377-
if "state" in stream_state and isinstance(stream_state["state"], dict) and stream_state["state"] != {}:
377+
if (
378+
"state" in stream_state
379+
and isinstance(stream_state["state"], dict)
380+
and stream_state["state"] != {}
381+
):
378382
substream_state = list(stream_state["state"].values())[0]
379383
else:
380384
return {}

unit_tests/sources/declarative/partition_routers/test_substream_partition_router.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -475,16 +475,14 @@ def test_substream_partition_router_invalid_parent_record_type():
475475
),
476476
# Case 7: Migrate child state to parent state but child state is empty
477477
(
478-
{
479-
"state": {},
480-
"states": [],
481-
"parent_state": {
482-
"posts": {}
483-
},
484-
"lookback_window": 1,
485-
"use_global_cursor": False
486-
},
487-
{},
478+
{
479+
"state": {},
480+
"states": [],
481+
"parent_state": {"posts": {}},
482+
"lookback_window": 1,
483+
"use_global_cursor": False,
484+
},
485+
{},
488486
),
489487
],
490488
ids=[

0 commit comments

Comments
 (0)