Skip to content

fix: surface state cursor parse errors#1028

Draft
devin-ai-integration[bot] wants to merge 2 commits into
mainfrom
devin/1778884375-state-cursor-error-message
Draft

fix: surface state cursor parse errors#1028
devin-ai-integration[bot] wants to merge 2 commits into
mainfrom
devin/1778884375-state-cursor-error-message

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot commented May 15, 2026

Summary

Resolves https://github.com/airbytehq/airbyte-internal-issues/issues/16441
Related to https://github.com/airbytehq/oncall/issues/12314

  • Wrap concurrent cursor state timestamp parse failures in an AirbyteTracedException with a specific user-facing message.
  • Preserve raw parse details in internal_message instead of relying on the generic connector fallback.
  • Add a focused regression test for legacy Snapchat Marketing-style state that no longer matches the connector's configured cursor formats.
  • Update an existing state-delegating stream test to expect the new structured exception type.

This is a CDK-level error-message improvement for source state parsing. It does not change schemas, specs, state format, or retry classification, so I do not believe it is breaking.

Review & Testing Checklist for Human

  • Confirm the user-facing message is appropriate for all concurrent CDK sources with unparseable state cursor timestamps, not only Snapchat Marketing.
  • Confirm wrapping ValueError during concurrent cursor initialization does not hide unrelated initialization errors that should remain raw.
  • Optionally verify an affected Snapchat Marketing state now emits the specific trace message after this CDK change.

Notes

Local checks run:

  • poetry run pytest unit_tests/sources/streams/concurrent/test_cursor.py::ConcurrentCursorStateTest::test_given_unparseable_state_cursor_when_initialize_then_raise_traced_exception -q
  • poetry run pytest unit_tests/sources/streams/concurrent/test_cursor.py unit_tests/sources/streams/concurrent/test_datetime_state_converter.py -q
  • poetry run pytest unit_tests/sources/declarative/test_state_delegating_stream.py::test_cursor_age_validation_raises_error_for_unparseable_cursor unit_tests/sources/streams/concurrent/test_cursor.py::ConcurrentCursorStateTest::test_given_unparseable_state_cursor_when_initialize_then_raise_traced_exception -q
  • poetry run ruff check airbyte_cdk/sources/streams/concurrent/cursor.py unit_tests/sources/streams/concurrent/test_cursor.py unit_tests/sources/declarative/test_state_delegating_stream.py
  • poetry run ruff format --check airbyte_cdk/sources/streams/concurrent/cursor.py unit_tests/sources/streams/concurrent/test_cursor.py unit_tests/sources/declarative/test_state_delegating_stream.py

Link to Devin session: https://app.devin.ai/sessions/6a6a8f8ec35248a3960a64b657a0899c

@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@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@devin/1778884375-state-cursor-error-message#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 devin/1778884375-state-cursor-error-message

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

github-actions Bot commented May 15, 2026

PyTest Results (Fast)

4 067 tests  +3 474   4 056 ✅ +3 474   7m 51s ⏱️ + 4m 20s
    1 suites ±    0      11 💤 +    1 
    1 files   ±    0       0 ❌  -     1 

Results for commit 0d8026e. ± Comparison against base commit 19a7083.

♻️ This comment has been updated with latest results.

Co-Authored-By: bot_apk <apk@cognition.ai>
@github-actions
Copy link
Copy Markdown

PyTest Results (Full)

4 070 tests  +1   4 058 ✅ +1   11m 30s ⏱️ +40s
    1 suites ±0      12 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 0d8026e. ± Comparison against base commit 19a7083.

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.

0 participants