elastic / elastic/eland

`eland.DataFrame.query` doesn't handle `datetime64` column

Open
#433 0 comments 0 reactions 0 assignees View on GitHub
topic:dataframe
Dominant language
Python
Stars
693
Forks
112
PR merge metrics
No merged PRs in 30d

Description

I am trying to query the DataFrame based on the `@timestamp` column, but it doesn't seem to work. Am I using the wrong syntax?

My df:
```
df.dtypes
---
@timestamp datetime64[ns]
kubernetes.pod.cpu.usage.limit.pct float64
kubernetes.pod.cpu.usage.nanocores int64
kubernetes.pod.cpu.usage.node.pct float64
kubernetes.pod.name object
metricset.name object
metricset.period int64
dtype: object
```

My query:
```
df.query('"@timestamp" > "2021-02-03"')
---
[/usr/local/lib/python3.7/dist-packages/pandas/core/computation/common.py](https://localhost:8080/#) in result_type_many(*arrays_and_dtypes)
21 """
22 try:
---> 23 return np.result_type(*arrays_and_dtypes)
24 except ValueError:
25 # we have > NPY_MAXARGS terms in our expression

<__array_function__ internals> in result_type(*args, **kwargs)

TypeError: data type '@timestamp' not understood
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.