Skip to content

Commit

Permalink
chore: fix build, ensure all dfs have unified date time types
Browse files Browse the repository at this point in the history
  • Loading branch information
tobymao committed May 8, 2024
1 parent 914fa59 commit c720b14
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/core/engine_adapter/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ def _init_engine_adapter(self) -> None:

def _format_df(self, data: pd.DataFrame, to_datetime: bool = True) -> pd.DataFrame:
for timestamp_column in self.timestamp_columns:
if timestamp_column in data.columns and to_datetime:
value = pd.to_datetime(data[timestamp_column])
if self.dialect == "duckdb":
value = value.astype("datetime64[us]")
data[timestamp_column] = value
if timestamp_column in data.columns:
value = data[timestamp_column]
if to_datetime:
value = pd.to_datetime(value)
data[timestamp_column] = value.astype("datetime64[ns]")
return data

def init(self):
Expand Down

0 comments on commit c720b14

Please sign in to comment.