Skip to content

fix(declarative): seed parent state only from a scalar legacy child cursor value - #1189

Merged
Baz (bazarnov) merged 1 commit into
mainfrom
bazarnov/fix-parent-state-fallback-scalar-only
Oct 2, 2026
Merged

Baz (bazarnov) merged 1 commit into
mainfrom
bazarnov/fix-parent-state-fallback-scalar-only

Conversation

@bazarnov

Copy link
Copy Markdown
Contributor

Summary

With incremental_dependency: true and no parent_state in the child state, _instantiate_parent_stream_state_manager re-keys a single child state value under the parent's cursor field. Since #707 it accepts any value, so a child state that is not a cursor value crashes the source at startup with ValueError: No format in [...] matching ...:

  • {"__ab_full_refresh_sync_complete": true}, the resumable full refresh sentinel (e.g. a stream migrated from a Python HttpStream);
  • a legacy per-partition {"states": [...]} without parent_state.

#1079 fixed the same crash for __ab_no_cursor_state_message only.

Changes

The fallback seeds the parent only from a non-bool str, int or float. Any other value leaves the parent state empty, so the parent starts from its configured start, as it does without state.

Tests

The #1079 test is parametrized over 7 child states: the 3 non-cursor shapes (2 fail on main) and 4 guards (str, int and float legacy values seed the parent; a multi-key state does not). Each clause is mutation-covered.

Supersedes #1069 and #1070.

…ursor value

A child state with a single non-cursor value, such as the resumable full
refresh sentinel or a legacy per-partition state without parent_state, was
re-keyed under the parent's cursor field and crashed the parent cursor
initialization with 'No format in [...] matching ...'.
@github-actions

Copy link
Copy Markdown

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

💡 Show Tips and Tricks

Testing This CDK Version

You can test this version of the CDK using the following:

# Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/airbyte-python-cdk.git@bazarnov/fix-parent-state-fallback-scalar-only#egg=airbyte-python-cdk[dev]' --help

# Update a connector to use the CDK from this branch ref:
cd airbyte-integrations/connectors/source-example
poe use-cdk-branch bazarnov/fix-parent-state-fallback-scalar-only

PR Slash Commands

Airbyte Maintainers can execute the following slash commands on your PR:

  • /autofix - Fixes most formatting and linting issues
  • /poetry-lock - Updates poetry.lock file
  • /test - Runs connector tests with the updated CDK
  • /prerelease - Triggers a prerelease publish with default arguments
  • /poe build - Regenerate git-committed build artifacts, such as the pydantic models which are generated from the manifest JSON schema in YAML.
  • /poe <command> - Runs any poe command in the CDK environment
📚 Show Repo Guidance

Helpful Resources

📝 Edit this welcome message.

@github-actions

Copy link
Copy Markdown

PyTest Results (Fast)

4 919 tests  +6   4 907 ✅ +6   10m 51s ⏱️ -2s
    1 suites ±0      12 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 966ed49. ± Comparison against base commit f243b0f.

This pull request removes 1 and adds 7 tests. Note that renamed tests count towards both.
unit_tests.sources.declarative.parsers.test_model_to_component_factory ‑ test_create_concurrent_cursor_from_perpartition_cursor_ignores_full_refresh_sentinel_state
unit_tests.sources.declarative.parsers.test_model_to_component_factory ‑ test_create_concurrent_cursor_from_perpartition_cursor_seeds_parent_only_from_a_cursor_value[full_refresh_sentinel]
unit_tests.sources.declarative.parsers.test_model_to_component_factory ‑ test_create_concurrent_cursor_from_perpartition_cursor_seeds_parent_only_from_a_cursor_value[legacy_epoch_cursor_value]
unit_tests.sources.declarative.parsers.test_model_to_component_factory ‑ test_create_concurrent_cursor_from_perpartition_cursor_seeds_parent_only_from_a_cursor_value[legacy_float_epoch_cursor_value]
unit_tests.sources.declarative.parsers.test_model_to_component_factory ‑ test_create_concurrent_cursor_from_perpartition_cursor_seeds_parent_only_from_a_cursor_value[legacy_per_partition_state_without_parent_state]
unit_tests.sources.declarative.parsers.test_model_to_component_factory ‑ test_create_concurrent_cursor_from_perpartition_cursor_seeds_parent_only_from_a_cursor_value[legacy_string_cursor_value]
unit_tests.sources.declarative.parsers.test_model_to_component_factory ‑ test_create_concurrent_cursor_from_perpartition_cursor_seeds_parent_only_from_a_cursor_value[multiple_values_are_not_a_legacy_cursor]
unit_tests.sources.declarative.parsers.test_model_to_component_factory ‑ test_create_concurrent_cursor_from_perpartition_cursor_seeds_parent_only_from_a_cursor_value[resumable_full_refresh_sentinel]

@github-actions

Copy link
Copy Markdown

PyTest Results (Full)

4 922 tests  +6   4 910 ✅ +6   15m 56s ⏱️ +6s
    1 suites ±0      12 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 966ed49. ± Comparison against base commit f243b0f.

This pull request removes 1 and adds 7 tests. Note that renamed tests count towards both.
unit_tests.sources.declarative.parsers.test_model_to_component_factory ‑ test_create_concurrent_cursor_from_perpartition_cursor_ignores_full_refresh_sentinel_state
unit_tests.sources.declarative.parsers.test_model_to_component_factory ‑ test_create_concurrent_cursor_from_perpartition_cursor_seeds_parent_only_from_a_cursor_value[full_refresh_sentinel]
unit_tests.sources.declarative.parsers.test_model_to_component_factory ‑ test_create_concurrent_cursor_from_perpartition_cursor_seeds_parent_only_from_a_cursor_value[legacy_epoch_cursor_value]
unit_tests.sources.declarative.parsers.test_model_to_component_factory ‑ test_create_concurrent_cursor_from_perpartition_cursor_seeds_parent_only_from_a_cursor_value[legacy_float_epoch_cursor_value]
unit_tests.sources.declarative.parsers.test_model_to_component_factory ‑ test_create_concurrent_cursor_from_perpartition_cursor_seeds_parent_only_from_a_cursor_value[legacy_per_partition_state_without_parent_state]
unit_tests.sources.declarative.parsers.test_model_to_component_factory ‑ test_create_concurrent_cursor_from_perpartition_cursor_seeds_parent_only_from_a_cursor_value[legacy_string_cursor_value]
unit_tests.sources.declarative.parsers.test_model_to_component_factory ‑ test_create_concurrent_cursor_from_perpartition_cursor_seeds_parent_only_from_a_cursor_value[multiple_values_are_not_a_legacy_cursor]
unit_tests.sources.declarative.parsers.test_model_to_component_factory ‑ test_create_concurrent_cursor_from_perpartition_cursor_seeds_parent_only_from_a_cursor_value[resumable_full_refresh_sentinel]

@bazarnov
Baz (bazarnov) merged commit d8f559e into main Oct 2, 2026
29 of 30 checks passed
@bazarnov
Baz (bazarnov) deleted the bazarnov/fix-parent-state-fallback-scalar-only branch October 2, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants