Skip to content

Conversation

@mccoyp
Copy link
Member

@mccoyp mccoyp commented Jun 30, 2021

This adds a custom JSONEncoder that can serialize datetime objects (dates, times, datetimes, and timedeltas) in UTC ISO 8601 format, as well as bytes and bytearrays in base64 strings.

@mccoyp mccoyp added Client This issue points to a problem in the data-plane of the library. Azure.Core labels Jun 30, 2021
@mccoyp mccoyp force-pushed the serialize-pr branch 2 times, most recently from e4e71cd to 6ec7641 Compare July 8, 2021 01:04
@mccoyp mccoyp marked this pull request as ready for review July 8, 2021 01:59
@mccoyp mccoyp requested a review from xiangyan99 as a code owner July 8, 2021 01:59
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mccoyp mccoyp requested a review from xiangyan99 July 9, 2021 01:46
@xiangyan99
Copy link
Member

/azp run python - core - ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@xiangyan99
Copy link
Member

@mccoyp _utils.py has been moved into utils folder.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the conversation starts regarding deserialization - we will want to make sure we support weird .NET timestamps (with extra decimal places). When that conversation happens - what we do to serialize round-tripped values will be important as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need to import a private type from a private submodule?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should rename _FixedOffset to FixedOffset. But not sure if it is worth...

@mccoyp mccoyp requested review from annatisch and johanste July 17, 2021 01:56
@iscai-msft
Copy link
Contributor

/azp run python - autorest - pr

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this still need int() around seconds?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't think so, since this AttributeError should only come up if seconds is an integer. seconds.is_integer() works when seconds is a float on 2.7. 3.6, and 3.9 when I test locally

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is currently part of the public API - which I don't think it should be, at least to start with.
Can we make it private?

@mccoyp mccoyp requested a review from annatisch July 26, 2021 21:19
@annatisch
Copy link
Member

/azp run python - core - ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mccoyp mccoyp requested a review from annatisch August 2, 2021 18:12
@mccoyp
Copy link
Member Author

mccoyp commented Aug 3, 2021

/azp run python - core - ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mccoyp
Copy link
Member Author

mccoyp commented Aug 4, 2021

/azp run python - core - ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mccoyp mccoyp enabled auto-merge (squash) August 4, 2021 01:33
@mccoyp mccoyp merged commit 6585a10 into Azure:main Aug 4, 2021
@mccoyp mccoyp deleted the serialize-pr branch August 4, 2021 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Azure.Core Client This issue points to a problem in the data-plane of the library.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants