Closed KinoriSR closed 4 years ago
@KinoriSR, Thanks for the question! We are investigating and will update you shortly.
rewriting the following code data_file = pd.read_csv(TIME_SERIES_DATA_PATH, header=None, encoding='utf-8', parse_dates=[0]) to data_file = pd.read_csv(TIME_SERIES_DATA_PATH, header=None, encoding='utf-8', date_parser=[0]) resolved the issue, not sure this is expected behavior or not
parse_dates is appending "Timestamp('2018-03-01 00:00:00+0000', tz='UTC')" where as date_parser is appending "'2018-04-08T00:00:00Z'" to series[]
@saikrishna-2017 I just tried this change and it complains about the str
. I tried this date format earlier by passing the string myself too. The error it gives:
'str' object has no attribute 'signed_session'
@saikrishna-2017 I just tried this change and it complains about the
str
. I tried this date format earlier by passing the string myself too. The error it gives:'str' object has no attribute 'signed_session'
Can you send full error message?
Here is the full traceback when I remove the try/except:
Traceback (most recent call last):
File "anomaly-detection-test.py", line 71, in <module>
response = anomaly_detector_client.entire_detect(request)
File "/usr/lib/python3/dist-packages/azure/cognitiveservices/anomalydetector/anomaly_detector_client.py", line 121, in entire_detect
response = self._client.send(request, stream=False, **operation_config)
File "/home/kinori/.local/lib/python3.8/site-packages/msrest/service_client.py", line 336, in send
pipeline_response = self.config.pipeline.run(request, **kwargs)
File "/home/kinori/.local/lib/python3.8/site-packages/msrest/pipeline/__init__.py", line 197, in run
return first_node.send(pipeline_request, **kwargs) # type: ignore
File "/home/kinori/.local/lib/python3.8/site-packages/msrest/pipeline/__init__.py", line 150, in send
response = self.next.send(request, **kwargs)
File "/home/kinori/.local/lib/python3.8/site-packages/msrest/pipeline/requests.py", line 65, in send
self._creds.signed_session(session)
AttributeError: 'str' object has no attribute 'signed_session'
@saikrishna-2017 I just tried this change and it complains about the
str
. I tried this date format earlier by passing the string myself too. The error it gives:'str' object has no attribute 'signed_session'
Can you send full error message?
@KinoriSR you are initializing the anomaly detector client in wrong way anomaly_detector_client = AnomalyDetectorClient(ANOMALY_DETECTOR_ENDPOINT, ANOMALY_DETECTOR_KEY) instead it should be anomaly_detector_client = AnomalyDetectorClient(ANOMALY_DETECTOR_ENDPOINT, CognitiveServicesCredentials(ANOMALY_DETECTOR_KEY))
Oh... missed that! Both using date_parser
and the CognitiveServicesCredentials
together resolved the issue. Thank you!
I tried running the example code to learn how the API works, but I get this error when I run it:
Unable to serialize value: Timestamp('2018-03-01 00:00:00+0000', tz='UTC') as type: 'iso-8601'., TypeError: an integer is required
I tried messing with the timestamps and looking through docs, but only succeeded in more errors. Am I missing something/making a mistake?
The code is from the example on: https://docs.microsoft.com/en-us/azure/cognitive-services/anomaly-detector/quickstarts/client-libraries?tabs=windows&pivots=programming-language-python
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.