question

Upvotes
Accepted
3 1 3 4

Snapping zero-values with the Python RDP library

I'm using the latest release of the RDP python library (1.0.0a7.post7), in particular the get_snapshot() function of the StreamingPrices class. If the value I'm snapping happens to be a float equal to zero (say a yield of 0%), the function get_snapshot() returns None. This is confusing since None is also returned if no value could be found.

Is it possible to make RDP return the value 0 instead of None when the field contains the value 0?

The issue seems to be caused by line 266 in StreamingPrices.py which treats non-existing fields the same way as fields with a value of 0: if _all_fields_value[name].get(f) else None

rdp-apirefinitiv-data-platform
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.

Extending triage

<AHS only>

Extending triage

<AHS>

Hi @umer.nalla

The RDP library for Python version 1.0.0a8.post1 just released on 16th April. Do you have any information from the Dev team on whether it includes the fix of this issue?

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

Thanks,


AHS


Upvotes
Accepted
25.3k 87 12 25

Hi @Sabina Tanase

Apologies - a misunderstanding.

I have been advised by the RD Library team that this bug has been fixed in refinitiv-dataplatform 1.0.0a8.post2 - which will be available soon on PyPi.

I will try and update once I know it is available.

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.

Upvotes
25.3k 87 12 25

Hi @Sabina Tanase

Thanks for reporting this issue - I have passed it on to the RDP Python library dev team and will get back to you once I get a response / fix release details.

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.

chased the RDP team for an update again.

Upvotes
25.3k 87 12 25

Hi @Sabina Tanase

RDP team have advised that a fix for this should be in the end of Q1 release - no exact date yet.


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.

Upvotes
3 1 3 4

Hi @umer.nalla

Unfortunately, we do not see this issue as being fixed. Using e.g. 1.0.0a10 from Eikon code book I can reproduce the error. Trying to snap PRIMACT_1 for the ticker DKDISC= should give the floating-point number 0.0 (since this interest rate is currently 0.0%), but instead returns None.

capture4.png

capture3.png


capture4.png (20.7 KiB)
capture3.png (6.7 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.

Upvotes
25.3k 87 12 25

Hi @Sabina Tanase

Sorry to hear it is not working still.

I will check with the RDP Library team and get back to you.

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.

Hi @Sabina Tanase

I can confirm I was able to recreate with a10 and I have reported to the RDP Python Library team. I will get back once I hear back.

Upvote
25.3k 87 12 25

Hi @Sabina Tanase

The RDP Library team investigated and responded with an apology. Unfortunately, they mixed up the changes for the existing RDP Python library and the newer RD Python Library they were working on at the time.

The fix was implemented in the RD Library - but not the RDP Library. They have added this bug to the list for a forthcoming RDP Python Library release. They should hopefully confirm an estimated release date for the fix to me tomorrow.

As an alternative to the RDP Python library - you may want to explore the newer RD Library.

For a position statement on RDP Library vs RD Library from the RDP Library owner, please see this page: Refinitiv Data Platform Libraries | Refinitiv Developers

To explore the newer RD Library please refer to this page: Refinitiv Data Library for Python | Refinitiv Developers

I have tested this bug with RD Libraries and it is working correctly e.g.

stream = rd.content.pricing.Definition(
    universe = 'DKDISC=', 
    fields = ['PRIMACT_1']
).get_stream()
stream.open()
stream.get_snapshot()

returns:

1641817598743.png



1641817598743.png (1.8 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.

Upvote
25.3k 87 12 25

Hi @Sabina Tanase

Just to confirm this issue has now been fixed in the a13 release

refinitiv-dataplatform 1.0.0a13 - PyPi


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.