Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Make the pandas client easy to use, and fix the precision invalids #555

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions influxdb/_dataframe_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,10 @@ def _convert_dataframe_to_json(dataframe,
tags = tags if tags is not None else {}
# Assume field columns are all columns not included in tag columns
if not field_columns:
field_columns = list(
set(dataframe.columns).difference(set(tag_columns)))
#field_columns = list(
# set(dataframe.columns).difference(set(tag_columns)))
field_columns_buf = list(set(dataframe.columns).difference(set(tag_columns)))
field_columns = [str(field_column) for field_column in field_columns_buf]

dataframe.index = dataframe.index.to_datetime()
if dataframe.index.tzinfo is None:
Expand Down
2 changes: 1 addition & 1 deletion influxdb/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ def _write_points(self,
retention_policy,
tags,
protocol='json'):
if time_precision not in ['n', 'u', 'ms', 's', 'm', 'h', None]:
if time_precision not in ['n', 'u', 'ms', 's', 'm', 'h', 'N', 'U', 'L', 'S', 'M', 'H', None]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what these extra time precision components are meant to be?

raise ValueError(
"Invalid time precision is given. "
"(use 'n', 'u', 'ms', 's', 'm' or 'h')")
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy