Skip to content

Commit

Permalink
fix the warning (#1656)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andyli1007 authored Nov 3, 2023
1 parent fb80e31 commit 8bf2678
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/dump_bin.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def _get_date(

def _get_source_data(self, file_path: Path) -> pd.DataFrame:
df = pd.read_csv(str(file_path.resolve()), low_memory=False)
df[self.date_field_name] = df[self.date_field_name].astype(str).astype(np.datetime64)
df[self.date_field_name] = df[self.date_field_name].astype(str).astype("datetime64[ns]")
# df.drop_duplicates([self.date_field_name], inplace=True)
return df

Expand Down Expand Up @@ -195,7 +195,7 @@ def save_instruments(self, instruments_data: Union[list, pd.DataFrame]):
def data_merge_calendar(self, df: pd.DataFrame, calendars_list: List[pd.Timestamp]) -> pd.DataFrame:
# calendars
calendars_df = pd.DataFrame(data=calendars_list, columns=[self.date_field_name])
calendars_df[self.date_field_name] = calendars_df[self.date_field_name].astype(np.datetime64)
calendars_df[self.date_field_name] = calendars_df[self.date_field_name].astype("datetime64[ns]")
cal_df = calendars_df[
(calendars_df[self.date_field_name] >= df[self.date_field_name].min())
& (calendars_df[self.date_field_name] <= df[self.date_field_name].max())
Expand Down

0 comments on commit 8bf2678

Please sign in to comment.