From 03c6b8138307d7e439414368f6970956dbeae2ca Mon Sep 17 00:00:00 2001 From: lixiliu <36629962+lixiliu@users.noreply.github.com> Date: Tue, 12 Nov 2024 23:32:51 -0700 Subject: [PATCH] add doc str --- src/chronify/time_series_mapper_representative.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/chronify/time_series_mapper_representative.py b/src/chronify/time_series_mapper_representative.py index c7b1143..4401a42 100644 --- a/src/chronify/time_series_mapper_representative.py +++ b/src/chronify/time_series_mapper_representative.py @@ -82,6 +82,7 @@ def map_time(self) -> None: def _create_mapping_dataframe_tz_naive( self, dft: pd.DataFrame, to_time_col: str ) -> pd.DataFrame: + """Create tz-naive time mapping dataframe""" dfm = dft.copy() dfm["month"] = dfm[to_time_col].dt.month dow = dfm[to_time_col].dt.day_of_week @@ -100,6 +101,7 @@ def _create_mapping_dataframe_tz_naive( def _create_mapping_dataframe_tz_aware( self, dft: pd.DataFrame, to_time_col: str ) -> pd.DataFrame: + """Create tz-aware time mapping dataframe according to to_schema.time_config""" with self._engine.connect() as conn: table = Table(self.from_schema.name, self._metadata) stmt = select(table.c["time_zone"]).distinct().where(table.c["time_zone"].is_not(None)) @@ -128,6 +130,7 @@ def _create_mapping_dataframe_tz_aware( return dfm def _apply_mapping(self, map_table_schema: TableSchema): + """Apply mapping to create result as a view according to_schema""" left_table = Table(self.from_schema.name, self._metadata) right_table = Table(map_table_schema.name, self._metadata) left_table_columns = [x.name for x in left_table.columns]