Skip to content
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

[Core] Follow RFC 3339 datetime formatting for AzureJSONEncoder #20346

Merged
merged 3 commits into from
Aug 31, 2021

Conversation

mccoyp
Copy link
Member

@mccoyp mccoyp commented Aug 18, 2021

Resolves #20190.

@mccoyp mccoyp added Client This issue points to a problem in the data-plane of the library. Azure.Core labels Aug 18, 2021
else:
iso_formatted = o.astimezone(TZ_UTC).isoformat()
# Replace the trailing "+00:00" UTC offset with "Z" (RFC 3339: https://www.ietf.org/rfc/rfc3339.txt)
return iso_formatted.replace("+00:00", "Z")
Copy link
Contributor

Choose a reason for hiding this comment

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

this is I think tangential to this specific PR, but I was looking into the msrest rfc serialization and we don't currently support that. Is this something I want to add?

msrest serialize rfc output:

serialize_rfc(isodate.parse_datetime("0001-01-01T00:00:00Z")) == 'Mon, 01 Jan 0001 00:00:00 GMT'

azure.core.serialization

json.dumps(isodate.parse_datetime("0001-01-01T00:00:00Z"), cls=AzureJSONEncoder) == "0001-01-01T00:00:00Z"

cc @lmazuel

Copy link
Member

Choose a reason for hiding this comment

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

Just to clear, your question has indeed mothing to do with @mccoyp 's PR :p . But yes, we could think about having a RFC HTTP header format serializer (not same RFC than here)

Copy link
Contributor

Choose a reason for hiding this comment

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

@mccoyp i'm totally wrong here please ignore me

@iscai-msft
Copy link
Contributor

/azp run python - autorest - pr

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mccoyp mccoyp requested a review from iscai-msft August 18, 2021 23:24
@iscai-msft
Copy link
Contributor

/azp run python - autorest - pr

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@iscai-msft
Copy link
Contributor

/azp run python - autorest - pr

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@iscai-msft iscai-msft left a comment

Choose a reason for hiding this comment

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

lgtm, should probably wait for @annatisch to review though

@mccoyp mccoyp merged commit 6821987 into Azure:main Aug 31, 2021
@mccoyp mccoyp deleted the iso-z branch August 31, 2021 21:19
iscai-msft added a commit to iscai-msft/azure-sdk-for-python that referenced this pull request Aug 31, 2021
…into update_lro_paging

* 'main' of https://github.com/Azure/azure-sdk-for-python:
  [Core] Follow RFC 3339 datetime formatting for AzureJSONEncoder (Azure#20346)
  [Key Vault] Add 7.3-preview support for certificates (Azure#20477)
  Use dummy values and correct code rendering in README (Azure#20322)
  Use CredScan-suppressed dummy password in sample (Azure#20468)
  Fix type annotation in azure.storage.blob (Azure#20084)
  Adding static checks (Azure#20457)
  release_iseus_status_auto_reply (Azure#20441)
  Clarify LogsQueryClient query parameter description (Azure#20467)
  Sync eng/common directory with azure-sdk-tools for PR 1953 (Azure#20466)
  Skip eng common workflow enforcer for private repos (Azure#20462)
  remove iter_text and iter_lines (Azure#20460)
iscai-msft added a commit that referenced this pull request Aug 31, 2021
…into header_tuples

* 'main' of https://github.com/Azure/azure-sdk-for-python:
  [Core] Follow RFC 3339 datetime formatting for AzureJSONEncoder (#20346)
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.

[Core] Update AzureJSONEncoder's datetime format
4 participants