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

Column Tags

Open jzay opened this issue 5 years ago • 1 comments

I'm trying to follow this stackoverflow post to store oder book data.

I'm getting an error when I add "tag_columns=['Level']" to the write_points function.

Error Message: TypeError write_points() got an unexpected keyword argument 'tag_columns'

  • InfluxDB version: 1.7.7
  • InfluxDB-python version: 5.3.0
  • Python version: 3.6.4
  • OS: macOS 10.14.6

jzay avatar May 25 '20 13:05 jzay

AFAIK write_points only has tags as a key in it. So instead of tag_columns use tags

Edit

DataFrameClient does have tag_columns.

Unless you are writing a Pandas DataFrame into InfluxDB use:

now = pd.Timestamp('1970-01-01 00:00+00:00')
        dataframe = pd.DataFrame(data=[['blue', 1, "1", 1, 1.0],
                                       ['red', 0, "2", 2, 2.0]],
                                 index=[now, now + timedelta(hours=1)],
                                 columns=["tag_one", "tag_two", "column_one",
                                          "column_two", "column_three"])
cli = DataFrameClient(database='db')
cli.write_points(dataframe, tag_columns=['tag_one', 'tag_tow'])

shantanoo-desai avatar May 25 '20 14:05 shantanoo-desai