question

Upvotes
Accepted

Cannot make Streaming data work in refinitiv-dataplatform library 1.0.0a0

Hello,

I am migrating my apps to refinitiv-dataplatform-1.0.0a0 and found that Streaming data dosen't work. I found that in pricing_.py during open_stream(), the function instantiate StreamingPrice with parameters that different from the constructor of the class. Could you please check?

Thanks

rdp-apirefinitiv-data-platformrefinitiv-data-platform-librariesstreaming-prices
icon clock
10 |1500

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

Upvotes
Accepted

Hi @Preeti.Gupta,


I have chatted with the development team, they will release a new version with this issue fix, soon. Please upgrade to new version when it is released.

icon clock
10 |1500

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

Upvotes
7.6k 15 6 9

@weerayoot.chaisirithavornkul

Can you provide the codes/parameters that look different from the constructor of the class? and elaborate more on the issue?


I did a quick check the pricin_.py and streamingprice.py from the site-packages and it seems to be a correct one. Also, try running the sample 2.3.0 - Content - StreamingPrices - Update DataFrame.ipynb and not found the problem.



icon clock
10 |1500

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

Upvotes
20.3k 73 10 20

Hi @weerayoot.chaisirithavornkul,

You can also try out the alternative examples under Developer Day Resources

These examples use a Session helper class which also outputs session events and status information - which may provide useful information.

In addition to this you can enable logging for the session in case you need additional diagnostics e.g.

mySession = get_session("platform")
mySession.set_log_level(6)
mySession.open()


icon clock
10 |1500

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

Upvotes

Hello @moragodkrit,


in pricing_.py line 248

self._streaming_prices[universe] = StreamingPrice(self._session,

name=universe,

fields=fields,

streaming=not close_after_snapshot,

on_refresh=on_refresh,

on_update=on_update,

on_status=on_status,

on_complete=on_complete)


while StreamingPrice's constructor is

def __init__(self,

name,

session=None,

fields=None,

service=None,

streaming=None,

extended_params=None,

on_refresh=None,

on_status=None,

on_update=None,

on_complete=None,

on_error=None):

It seems the caller pass self._session to where is supposed to be name, and pass universe as an optional parameter which the called method doesn't accept name as an optional parameter.


Could you please check?

icon clock
10 |1500

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

@Olivier DEVANT

It seems to be an issue with the order of argument used inside the method open_stream from Pricing class. Can you check with Dev?
It looks like the correct codes at line 248 should be

StreamingPrice(session=self._session,...)

Otherwise, it will return

TypeError: __init__() got multiple values for argument 'name'

when you call

rdp.Pricing().open_stream(universe="EUR=")

Upvotes
20.3k 73 10 20

Hi @weerayoot.chaisirithavornkul,

Please confirm which example you are running / code you are using and please expand on what you mean by 'Streaming data dosen't work'

icon clock
10 |1500

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

Upvotes
7 1 2 1

Hi @weerayoot.chaisirithavornkul,

did you get solution regarding this? I am facing the same issue while migrating the code. Thanks.

icon clock
10 |1500

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

Hi @Preeti.Gupta

If you are migrating code written to work with an older version of RDP Library, please note that the StreamingPrice Class was renamed to StreamingPrices for the latest alpha version. If you are using StreamingPrice, please change to StreamingPrices and see if that helps.

Note that there still is a StreamingPrice class - but that only allows a single RIC, whereas StreamingPrices allows multiple - and the parameters are slightly different too.

Hi @Umer Nalla,

Thanks for your reply. Yes, I am migrating the code and I have made changes to StreamingPrices (thank you for providing insight). But the issue which I am facing is related with open_stream function call.

I am getting error - TypeError: __init__() got multiple values for argument 'name'

Click below to post an Idea Post Idea