(self)
| 269 | return df.loc[start_time:end_time] |
| 270 | |
| 271 | def _maybe_load_raw_data(self): |
| 272 | if self._data is not None: |
| 273 | return |
| 274 | if isinstance(self._config, dict): |
| 275 | self._data = pd.concat( |
| 276 | {fields_group: load_dataset(path_or_obj) for fields_group, path_or_obj in self._config.items()}, |
| 277 | axis=1, |
| 278 | join=self.join, |
| 279 | ) |
| 280 | self._data.sort_index(inplace=True) |
| 281 | elif isinstance(self._config, (str, Path)): |
| 282 | if str(self._config).strip().endswith(".parquet"): |
| 283 | self._data = pd.read_parquet(self._config, engine="pyarrow") |
| 284 | else: |
| 285 | with Path(self._config).open("rb") as f: |
| 286 | self._data = pickle.load(f) |
| 287 | elif isinstance(self._config, pd.DataFrame): |
| 288 | self._data = self._config |
| 289 | |
| 290 | |
| 291 | class NestedDataLoader(DataLoader): |
no test coverage detected