Skip to content

Commit a017dff

Browse files
fix: Skip retention check for concurrent state format
Add guard to detect concurrent state format (state_type/slices keys) and skip the retention check rather than defaulting to full refresh. Today is_sequential_state=True is hardcoded for all declarative cursors, so concurrent format state should never appear in practice. This guard prevents spurious full-refresh fallbacks if that assumption ever changes. Co-Authored-By: alfredo.garcia@airbyte.io <freddy.garcia7.fg@gmail.com>
1 parent 1defe9e commit a017dff

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3613,6 +3613,14 @@ def _is_cursor_older_than_retention_period(
36133613
invalid/unparseable (should use full refresh).
36143614
Returns False if the cursor is within the retention period (safe to use incremental).
36153615
"""
3616+
# Skip retention check for concurrent state format (e.g. {"state_type": "date-range", "slices": [...]}).
3617+
# The DatetimeBasedCursor used for the age check only handles sequential state format.
3618+
# Today, is_sequential_state=True is hardcoded for all declarative cursors, so concurrent
3619+
# format state should never appear in practice. If that changes in the future, this guard
3620+
# prevents spurious full-refresh fallbacks until proper concurrent cursor delegation is added.
3621+
if "state_type" in stream_state or "slices" in stream_state:
3622+
return False
3623+
36163624
for incremental_sync in incremental_sync_sources:
36173625
if isinstance(incremental_sync, IncrementingCountCursorModel):
36183626
raise ValueError(

0 commit comments

Comments
 (0)