Conversation
|
/azp run python - monitor - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run python - monitor - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run python - monitor - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run python - monitor - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run python - monitor - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run python - monitor - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| elif isinstance(timespan[1], timedelta): | ||
| start, duration = timespan[0], timespan[1] | ||
| else: | ||
| raise ValueError('Tuple must be a start datetime with a timedelta or an end datetime.') |
There was a problem hiding this comment.
Could you add some comments to describe the situation?
e.g. if isinstance(timespan[1], datetime): # if timespan is tuple[datetime, datetime], we treat it as [start time, end time].
| raise ValueError('Tuple must be a start datetime with a timedelta or an end datetime.') | ||
| except TypeError: | ||
| duration = timespan | ||
| if duration is not None: |
There was a problem hiding this comment.
We can just use if duration: :)
| iso_str = start + '/' + end | ||
| elif duration is not None: | ||
| iso_str = start + '/' + duration | ||
| else: |
There was a problem hiding this comment.
In which case will enter here?
There was a problem hiding this comment.
premeptively raising in case start is provided with something other than a timedelta or a datetime
There was a problem hiding this comment.
It looks to me here is the case start is not None while end and duration are None?
There was a problem hiding this comment.
improved the message to warn about none explicitly
| raise ValueError("End time must be provided along with duration or start time.") | ||
| end = Serializer.serialize_iso(end) | ||
| iso_str = duration + '/' + end | ||
| else: |
There was a problem hiding this comment.
Also, in which case will enter here?
There was a problem hiding this comment.
in case timespan is a timedelta and no start is provided
|
/azp run python - monitor - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…into have_pipelines_support_rest * 'main' of https://github.com/Azure/azure-sdk-for-python: (108 commits) Enable API review approval check for Java spring packages (Azure#20311) [AutoRelease] t2-iothubprovisioningservices-2021-07-15-81882 (Azure#19816) Increment package version after release of azure-eventgrid (Azure#20204) Sync eng/common directory with azure-sdk-tools for PR 1909 (Azure#20298) Rename attrs is metrics (Azure#20236) [EventHubs] checkpointstoretable - skip tests until env vars configured (Azure#20289) Update to use timespan (Azure#20233) Prevent wildcard expansion in git sparse checkout add (Azure#20267) Fix typo and polish the key concepts (Azure#18407) Fix IOT Device Update readme issue (Azure#18752) Add context manager API to azure.identity credentials (Azure#19746) Add support for 'files' configuration (Azure#20272) Update main for 30-close.py (Azure#20287) [AutoRelease] t2-purview-2021-08-13-30358 (Azure#20260) add implementation for checkpointstoretable (Azure#19905) Fix resource clean-up script (Azure#20273) [Tables] Fix bug in update mode (Azure#20264) Add Rest Method checks to Prepare-Release (Azure#20275) Update release date (Azure#20270) Update the release date for ACS chat 1.1.0b1 (Azure#20277) ...
* Update to use timespan * lint * lint * lint + test * Update test_logs_client.py * comments * improve message
No description provided.