-
Notifications
You must be signed in to change notification settings - Fork 24
fix: ensure most_recent_cursor_value is deserialized #436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: ensure most_recent_cursor_value is deserialized #436
Conversation
/autofix
|
📝 WalkthroughWalkthroughThis pull request enhances the state deserialization process in the stream state converter by adding a conditional check in the Changes
Sequence Diagram(s)sequenceDiagram
participant C as Client
participant ASC as AbstractStreamStateConverter
participant F as _from_state_message
C->>ASC: deserialize(state)
ASC->>ASC: Check stream_slice for keys
alt Contains MOST_RECENT_RECORD_KEY
ASC->>F: Convert MOST_RECENT_RECORD_KEY value
F-->>ASC: Return converted value
ASC->>ASC: Update state with converted value
else No MOST_RECENT_RECORD_KEY
ASC->>ASC: Process other keys as usual
end
ASC-->>C: Return updated state
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code Definitions (2)airbyte_cdk/sources/streams/concurrent/state_converters/abstract_stream_state_converter.py (2)
unit_tests/sources/streams/concurrent/test_cursor.py (5)
⏰ Context from checks skipped due to timeout of 90000ms (8)
🔇 Additional comments (4)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Following issue on source-salesforce: https://airbytehq-team.slack.com/archives/C08JX410FJM
The issue was that we re-use the input dictionary for the state but
most_recent_cursor_value
was not converted to a datetime which mean that when we were trying to serialize it, it would fail because of a typing issue (this field was still a string and not a datetime and hence would cause'str' object has no attribute 'year'
error).In order to fix that, we just have to properly deserialize
most_recent_cursor_value
. This wasn't an issue for low-code connectors because they have sequential state. source-salesforce has a partitioned state which is different.Summary by CodeRabbit