Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading non-numeric tags is NaN #141

Open
LukeJakielaszek opened this issue Nov 16, 2022 · 4 comments
Open

Reading non-numeric tags is NaN #141

LukeJakielaszek opened this issue Nov 16, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@LukeJakielaszek
Copy link

When reading tags that are not of numeric type, the tag is converted to a NaN value. This is due to line 489 of webhandlers.py and can be resolved by just removing the line. The line attempts to convert the tag to a numeric value, but it really should first check that the tag is numeric in the first place or allow the user to specify which tags are numeric.

# Ensure non-numericals like "1.#QNAN" are returned as NaN
df["Value"] = pd.to_numeric(df.Value, errors="coerce")

https://github.com/equinor/tagreader-python/blob/master/tagreader/web_handlers.py

@franktoffel
Copy link

This seems good, has this been patched?

@franktoffel
Copy link

Any update?

@DWMorrow
Copy link

DWMorrow commented Aug 11, 2023

The only way I was able to overcome this is by using SQL extract.
c = tagreader.IMSClient()
df = c.query_sql(query=f"SELECT * FROM {table};",parse=False)

Using the experimental query_sql returns categorical values. Then use c.read() for numeric values. Not a solution, rather a workaround.

@Asgmel03
Copy link
Contributor

Hello,
I apologize for the (really) late reply from us. The Tagreader project has been shuffled around internally for a while, so no issues or PR's have been followed up for a while.

We have put this issue on our project backlog and will look into it soon. I will update you once we have a fix.

@Asgmel03 Asgmel03 added the bug Something isn't working label Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants