influxdb3-python 0.3.2__py3-none-any.whl → 0.3.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: influxdb3-python
3
- Version: 0.3.2
3
+ Version: 0.3.4
4
4
  Summary: Community Python client for InfluxDB 3.0
5
5
  Home-page: https://github.com/InfluxCommunity/influxdb3-python
6
6
  Author: InfluxData
@@ -158,6 +158,16 @@ with InfluxDBClient3.InfluxDBClient3(
158
158
 
159
159
  ```
160
160
 
161
+ ### Pandas DF
162
+ ```python
163
+ client._write_api.write(bucket="pokemon-codex", record=pd_df, data_frame_measurement_name='caught', data_frame_tag_columns=['trainer', 'id', 'num'], data_frame_timestamp_column='timestamp')
164
+ ```
165
+
166
+ ### Polars DF
167
+ ```python
168
+ client._write_api.write(bucket="pokemon-codex", record=pl_df, data_frame_measurement_name='caught', data_frame_tag_columns=['trainer', 'id', 'num'], data_frame_timestamp_column='timestamp')
169
+ ```
170
+
161
171
  ## Querying
162
172
 
163
173
  ### Querying with SQL
@@ -1,5 +1,5 @@
1
1
  influxdb_client_3/__init__.py,sha256=clFH4kMx1V1KYRJ1uSeh_X2UlOtFwvnt-LNztM-4IpU,11197
2
- influxdb_client_3/read_file.py,sha256=OKqmjaAdE2xDbd1hwaugaKIWW34LFYJjZ9gds8Hv1bY,2965
2
+ influxdb_client_3/read_file.py,sha256=C4qZmf4zvk6qsxbqUVJ7uwntXnsDa_d3ApcfaFg3PtM,3003
3
3
  influxdb_client_3/write_client/__init__.py,sha256=KVDc02lV02u8ZqLLuqQrAWobmCV4gCAu-jW96HiS8e8,1140
4
4
  influxdb_client_3/write_client/configuration.py,sha256=7rEi21JLLcO2cmER3jhu8cK8eHur-asA3uBgCR70hSM,9498
5
5
  influxdb_client_3/write_client/extras.py,sha256=OpzhncX1ymwws0k8hQg5xt0emLl9LynrEIHdiqjmQ0g,562
@@ -21,7 +21,7 @@ influxdb_client_3/write_client/client/util/date_utils_pandas.py,sha256=In0xT5Zg1
21
21
  influxdb_client_3/write_client/client/util/helpers.py,sha256=hBu3bw9Tv_K-D69uwXPidcSR3hEpbNOAswgInX8wMbM,1910
22
22
  influxdb_client_3/write_client/client/util/multiprocessing_helper.py,sha256=NcRrCM7ljlBw00pnVMsc604tpsZxdtGZ8WspGsb8X5E,7418
23
23
  influxdb_client_3/write_client/client/write/__init__.py,sha256=BZtc2FtJkBlJ8Db6aTpOmuLaCvOS4ZOyv8n1hugRjxI,598
24
- influxdb_client_3/write_client/client/write/dataframe_serializer.py,sha256=tamC2EXTifVj8-586PszZ6rit2UNm7TXNQfHBEqUUmA,20720
24
+ influxdb_client_3/write_client/client/write/dataframe_serializer.py,sha256=5Xz3xQ7k2MFzWKRGKnFHnHYDzkZu3hZ_TG8z510RjHQ,20923
25
25
  influxdb_client_3/write_client/client/write/point.py,sha256=WPvlrmFrxt4ZRqt6j9ubqrwo3l3UgjmVUTz9J6FNkQ0,12951
26
26
  influxdb_client_3/write_client/client/write/retry.py,sha256=pocMojfU6W0goqRn89pKXw8gshbT5FwJ2Ng6qKaz4nc,5947
27
27
  influxdb_client_3/write_client/domain/__init__.py,sha256=Yh0H5hMyo3oUa8qutwyFDuOcMLRR_jA4OaKvJUYCtWY,461
@@ -31,8 +31,8 @@ influxdb_client_3/write_client/service/_base_service.py,sha256=5rv-9BJ7mYx_ZvxsC
31
31
  influxdb_client_3/write_client/service/signin_service.py,sha256=oZ5xI7Be-xleHE7ElAXc1kX7DeOBVKcruMB2P3_lqDQ,8772
32
32
  influxdb_client_3/write_client/service/signout_service.py,sha256=6OFdrVMNMwIuqWnt7EbUIMvIMqHyEfnIuG-FVJTCgYM,9103
33
33
  influxdb_client_3/write_client/service/write_service.py,sha256=zaNShD1uP8w-MUbSz402Mpbun-Zkepd5ko3zJFFFYOQ,20552
34
- influxdb3_python-0.3.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
35
- influxdb3_python-0.3.2.dist-info/METADATA,sha256=nDJR6amrgmDvkcRjNCd96n4grulMm_nFa8PJafOVDTU,7264
36
- influxdb3_python-0.3.2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
37
- influxdb3_python-0.3.2.dist-info/top_level.txt,sha256=qyXYKadWgc00VaRkVtlYmiwjXvqmKzb1CHIAjlXMmK4,18
38
- influxdb3_python-0.3.2.dist-info/RECORD,,
34
+ influxdb3_python-0.3.4.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
35
+ influxdb3_python-0.3.4.dist-info/METADATA,sha256=1keoVQazpBOgFjyXvUkDHHEkLDZltEXoaHYuOiXC-RQ,7702
36
+ influxdb3_python-0.3.4.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
37
+ influxdb3_python-0.3.4.dist-info/top_level.txt,sha256=qyXYKadWgc00VaRkVtlYmiwjXvqmKzb1CHIAjlXMmK4,18
38
+ influxdb3_python-0.3.4.dist-info/RECORD,,
@@ -3,13 +3,6 @@ import pyarrow.csv as csv
3
3
  import pyarrow.feather as feather
4
4
  import pyarrow.parquet as parquet
5
5
 
6
- try:
7
- import pandas as pd
8
- except ImportError:
9
- raise ImportError("Pandas is required for write_file(). Please install it using 'pip install pandas' or 'pip install influxdb3-python[pandas]'")
10
-
11
-
12
-
13
6
  # Check if the OS is not Windows
14
7
  if os.name != 'nt':
15
8
  import pyarrow.orc as orc
@@ -103,4 +96,9 @@ class UploadFile:
103
96
  :type file: str
104
97
  :return: The loaded JSON file.
105
98
  """
99
+ try:
100
+ import pandas as pd
101
+ except ImportError:
102
+ raise ImportError("Pandas is required for write_file(). Please install it using 'pip install pandas' or 'pip install influxdb3-python[pandas]'")
103
+
106
104
  return pd.read_json(file, **self._kwargs)
@@ -310,6 +310,9 @@ class PolarsDataframeSerializer:
310
310
 
311
311
  self.column_indices = {name: index for index, name in enumerate(data_frame.columns)}
312
312
 
313
+ if self.timestamp_column is None or self.timestamp_column not in self.column_indices:
314
+ raise ValueError(f"Timestamp column {self.timestamp_column} not found in DataFrame. Please define a valid timestamp column.")
315
+
313
316
  #
314
317
  # prepare chunks
315
318
  #
@@ -373,7 +376,6 @@ class PolarsDataframeSerializer:
373
376
  df = self.data_frame
374
377
 
375
378
  # Convert timestamp to unix timestamp
376
- print(self.precision)
377
379
  if self.precision is None:
378
380
  df = df.with_columns(pl.col(self.timestamp_column).dt.epoch(time_unit="ns").alias(self.timestamp_column))
379
381
  elif self.precision == 'ns':