-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Conversation
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") |
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.
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
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 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)
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.
@mccoyp i'm totally wrong here please ignore me
/azp run python - autorest - pr |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run python - autorest - pr |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run python - autorest - pr |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
lgtm, should probably wait for @annatisch to review though
…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)
…into header_tuples * 'main' of https://github.com/Azure/azure-sdk-for-python: [Core] Follow RFC 3339 datetime formatting for AzureJSONEncoder (#20346)
Resolves #20190.