tagreader-python icon indicating copy to clipboard operation
tagreader-python copied to clipboard

Reading non-numeric tags is NaN

Open LukeJakielaszek opened this issue 3 years ago • 4 comments

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

LukeJakielaszek avatar Nov 16 '22 20:11 LukeJakielaszek

This seems good, has this been patched?

franktoffel avatar Mar 03 '23 09:03 franktoffel

Any update?

franktoffel avatar Jun 30 '23 10:06 franktoffel

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.

DWMorrow avatar Aug 11 '23 14:08 DWMorrow

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 avatar Oct 22 '24 12:10 Asgmel03