-
Notifications
You must be signed in to change notification settings - Fork 30
fix: add type validation in DatetimeParser.parse() to handle list, dict, and None inputs #785
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: add type validation in DatetimeParser.parse() to handle list, dict, and None inputs #785
Conversation
…ct, and None inputs This fix addresses TypeError issues reported in oncall issue #9163 and similar issues where DatetimeParser.parse() is called with invalid input types (list, dict, None) instead of expected timestamp types (str, int, float). The error occurred when concurrent cursor state converters attempted to parse partitioned state structures that contained lists or nested dictionaries as cursor values. This affected multiple connectors including source-zendesk-support, source-intercom, and source-stripe. Changes: - Add explicit type validation at the start of parse() to reject None, list, and dict inputs - Provide clear error messages indicating the expected types vs actual type received - Add try-catch blocks around timestamp conversions for better error handling - Add comprehensive test coverage for all invalid input types Fixes: airbytehq/oncall#9163 Related: airbytehq/oncall#9126, airbytehq/oncall#9138, airbytehq/oncall#8674, airbytehq/oncall#8154, airbytehq/oncall#8386, airbytehq/oncall#7783, airbytehq/oncall#7473 Co-Authored-By: unknown <>
Original prompt from API User
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. Testing This CDK VersionYou 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/1760018855-fix-datetime-parser-type-handling#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/1760018855-fix-datetime-parser-type-handling Helpful ResourcesPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
Co-Authored-By: unknown <>
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. Testing This CDK VersionYou 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/1760018855-fix-datetime-parser-type-handling#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/1760018855-fix-datetime-parser-type-handling Helpful ResourcesPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
fix: add type validation in DatetimeParser.parse() to handle list, dict, and None inputs
Summary
This PR fixes the
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'
reported in oncall issue #9163 and similar issues affecting multiple connectors (Zendesk Support, Intercom, Stripe).The error occurred when
DatetimeParser.parse()
was called with invalid input types (list, dict, None) instead of expected timestamp types (str, int, float). This commonly happens when concurrent cursor state converters attempt to parse partitioned state structures that contain nested arrays or dictionaries.Changes:
parse()
to reject None, list, and dict inputs with clear error messagesReview & Testing Checklist for Human
This is a defensive fix with moderate risk. Please verify:
Notes
Link to Devin run: https://app.devin.ai/sessions/954333332fc24e6d8f5320322a82a2f2
Requested by: agarctfi