question

Upvotes
Accepted
1 0 0 0

Snapping zero-values with the Python RD library

Hi devs,

There is a critical bug in the newly released refinitiv-data Python library, where zero-values are snapped as pd.NA. The error is caused by the highlighted snippet in refinitiv\data\content\_universe_streams.py in the build_df method.

data = (
        (inst_name, *(values.pop(0) or pd.NA for values in values_by_field.values()))
        for inst_name in universe
    )

This is a common antipattern, where falsy values are nullified. Unfortunately this causes valid data, e.g. 0, to be nullified in the output.

There was a similar error in the alpha version of refinitiv-dataplatform (v.1.0.0.a10, Snapping zero-values with the Python RDP library - Forum | Refinitiv Developer Community).

Please add a unit test to ensure that this bug doesn't keep reappearing.

python#productrefinitiv-dataplatform-libraries
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.

<AHS>

escalated to RD lib support team in MS Teams, here's the response from them

Sorry for this issue, I reproduced the issue. I created a ticket https://jira.refinitiv.com/browse/EAPI-4986 and we will fixt in the next version. When next version will be is available I`ll mention to this chat 
Hi @Philip Voldsgaard ,


I have checked the ticket it is resolved under version 1.1.0. Could you please validate this and accept @raksina.samasiri 's answer below:


Best regards,

Haykaz

Hi,

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

Thanks,

AHS

Upvotes
Accepted
14.2k 30 5 10

Hi @Philip Voldsgaard ,

Sorry for this issue. I've reported this to the related team already and I will keep you updated.

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
14.2k 30 5 10

Hi @Philip Voldsgaard ,

Thank you for raising this, please be informed that this issue has been fixed in RD Python 1.1.0

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.