question

Upvotes
Accepted
1 0 0 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.

1 Answer

Upvotes
Accepted
47.2k 109 44 60

@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.