Skip to content

Commit 7ef44e9

Browse files
author
Jay Clifford
committed
HOTFIX: print and error handle
1 parent f18a191 commit 7ef44e9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

influxdb_client_3/write_client/client/write/dataframe_serializer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,9 @@ def __init__(self, data_frame, point_settings, precision=DEFAULT_WRITE_PRECISION
310310

311311
self.column_indices = {name: index for index, name in enumerate(data_frame.columns)}
312312

313+
if self.timestamp_column is not 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+
313316
#
314317
# prepare chunks
315318
#
@@ -373,7 +376,6 @@ def serialize(self, chunk_idx: int = None):
373376
df = self.data_frame
374377

375378
# Convert timestamp to unix timestamp
376-
print(self.precision)
377379
if self.precision is None:
378380
df = df.with_columns(pl.col(self.timestamp_column).dt.epoch(time_unit="ns").alias(self.timestamp_column))
379381
elif self.precision == 'ns':

0 commit comments

Comments
 (0)