question

Upvotes
Accepted
1 0 1 1

Bug in from_json_to_df in PyDSWS

Hi,

It seems that, as of yesterday, there is a bug when converting dates with from_json_to_df

the following is coded:

import PyDSWS as pyDS
ds = pyDS.Datastream(username='xxxxx', password='yyyyy')
sec = ds.get_data(tickers='S&PCOMP', fields='PI', start='2001-09-05', end='2001-09-15', freq='D')

and the resulting output is:

File "C:\ProgramData\Anaconda3\lib\site-packages\PyDSWS\datastream.py", line 102, in get_data
df = self.from_json_to_df(response)

File "C:\ProgramData\Anaconda3\lib\site-packages\PyDSWS\datastream.py", line 41, in from_json_to_df
if response_json['Dates']:

KeyError: 'Dates'

Not sure why this error is occuring after running soomthly over the past weeks.
Same error occurs btw for different ticker and date requests.

datastream-apidsws-apijson
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hello @thijs.sanders,

Thank you for your participation in the forum.

Is the reply below satisfactory in resolving your query? If yes please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

-AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such. Thanks, AHS

1 Answer

· Write an Answer
Upvotes
Accepted
79.1k 250 52 74

@thijs.sanders

Can you please verify the output with this test page: https://product.datastream.com/DswsClient/Docs/TestRestV1.aspx?

1. Execute Get Token to retrieve the token

2. Use the retrieved token to execute Data (HTTP GET)


Then, verify the retrieved response.


1593503547804.png (45.0 KiB)
1593503601317.png (33.4 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.