-
Notifications
You must be signed in to change notification settings - Fork 3.1k
updating communication shared code to use the isodate instead of the … #42085
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
base: main
Are you sure you want to change the base?
updating communication shared code to use the isodate instead of the … #42085
Conversation
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.
Pull Request Overview
This PR replaces the python-dateutil
library with isodate
for datetime parsing across all Azure Communication Services SDK packages. The change standardizes datetime parsing using isodate.parse_datetime()
instead of dateutil.parser.parse()
while removing the external dependency from development requirements.
- Updates shared token utility modules to use isodate for parsing datetime strings
- Removes python-dateutil dependency from dev_requirements.txt files
- Maintains consistent datetime parsing functionality across all communication service packages
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
*/dev_requirements.txt | Removes python-dateutil dependency from development requirements |
*/token_utils.py | Replaces dateutil.parser with isodate for datetime parsing functionality |
sdk/communication/azure-communication-sms/azure/communication/sms/_shared/token_utils.py
Show resolved
Hide resolved
sdk/communication/azure-communication-sms/azure/communication/sms/_shared/token_utils.py
Show resolved
Hide resolved
I did some manual tests with the isdate change and everything works fine |
sdk/communication/azure-communication-sms/azure/communication/sms/_shared/token_utils.py
Show resolved
Hide resolved
sdk/communication/azure-communication-sms/azure/communication/sms/_shared/token_utils.py
Show resolved
Hide resolved
/check-enforcer override |
assert utc_time_in_sec == 0 | ||
# UTC naive (without a timezone specified) | ||
utc_naive_time_in_sec = _convert_datetime_to_utc_int(datetime(1970, 1, 1, 0, 0, 0, 0)) | ||
assert utc_naive_time_in_sec == 0 | ||
# PST is UTC-8 | ||
# PST is UTC-8 (Vancouver/Pacific Time) | ||
pst_tz = timezone(timedelta(hours=-8)) # PST is UTC-8 |
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.
nit for timezone info
pst_tz = timezone(timedelta(hours=-8)) # PST is UTC-8 | |
pst_tz = ZoneInfo("America/Los_Angeles") |
@@ -8,7 +8,7 @@ | |||
import json | |||
from datetime import datetime, timezone | |||
from typing import Tuple, Any, List, Optional | |||
from dateutil import parser as dateutil_parser # type: ignore | |||
import isodate # type: ignore |
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.
Do you know why this needs a type: ignore?
…date util
Description
Please add an informative description that covers that changes made by the pull request and link all relevant issues.
If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines