Skip to content

Commit

Permalink
Dels with empty results in query_influxdb
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Jul 15, 2024
1 parent 7ffa045 commit d73d627
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lvmapi/tools/influxdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ async def query_influxdb(query: str) -> polars.DataFrame:
query_results = await api.query(query)

df = polars.DataFrame(json.loads(query_results.to_json()))
df = df.with_columns(polars.col._time.cast(polars.Datetime("ms")))

if len(df) > 0:
df = df.with_columns(polars.col._time.cast(polars.Datetime("ms")))

return df

0 comments on commit d73d627

Please sign in to comment.