-
Notifications
You must be signed in to change notification settings - Fork 12
Fix Numeric strings being converted to Datetime objects #348
Conversation
… strings are datetime objects
…rosoft/kiota-serialization-json-python into shem/fix_pendulum_conversion_problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
Also:
- unit tests
- changelog
- version bump
- replicate in other serialization libraries
@@ -291,6 +293,10 @@ def _assign_field_values(self, item: U) -> None: | |||
deserialize but the model doesn't support additional data" | |||
) | |||
|
|||
def is_four_digit_number(self, value: str) -> bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just making sure this method is not accessible from outside of the class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an instance method, and we really just need it here in the entire project, so nope, not accessible outside the class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't it start with __ ?
Co-authored-by: Vincent Biret <[email protected]>
…rosoft/kiota-serialization-json-python into shem/fix_pendulum_conversion_problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for making the changes!
Added Unit tests, changelog and version bump The other serialization libraries do not use pendulum thus do not have the problem |
Quality Gate passedIssues Measures |
Fixes microsoftgraph/msgraph-sdk-python#653
Overview
The PR fixes a problem where pendulum assumes all 4-digit numeric strings are Datetimes, e. 1212, 1214, 2530, 9057
Fixes # microsoftgraph/msgraph-sdk-python#653
Demo
The Script below,
Output before
Output After
Notes
This change could be reverted if pendulum does an update that fixes the bug.
Testing Instructions