From 3dde0e4f97ec3f44595777aa9507d13c6c3d7d61 Mon Sep 17 00:00:00 2001 From: Sheng Lundquist Date: Fri, 15 Nov 2024 13:50:07 +0700 Subject: [PATCH] lint --- .../core/hyperdrive/interactive/chain.py | 18 ++++++++++++++++-- .../hyperdrive/interactive/local_hyperdrive.py | 4 +--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/agent0/core/hyperdrive/interactive/chain.py b/src/agent0/core/hyperdrive/interactive/chain.py index 419eccc0d..33fa63a7f 100644 --- a/src/agent0/core/hyperdrive/interactive/chain.py +++ b/src/agent0/core/hyperdrive/interactive/chain.py @@ -513,13 +513,27 @@ def _add_hyperdrive_name_to_dataframe(self, df: pd.DataFrame, addr_column: str): out.insert(df.columns.get_loc(addr_column), "hyperdrive_name", hyperdrive_name) # type: ignore return out - def dump_db(self, save_dir: Path): + def dump_db(self, save_dir: Path) -> None: + """Export the managed database to file. + + Arguments + --------- + save_dir: Path + The output directory to dump the data to. + """ if self.db_session is not None: # TODO parameterize the save path os.makedirs(save_dir, exist_ok=True) export_db_to_file(save_dir, self.db_session) - def load_db(self, load_dir: Path): + def load_db(self, load_dir: Path) -> None: + """Import the managed database from file. + + Arguments + --------- + load_dir: Path + The directory that contains the exported database. + """ if self.db_session is not None: # TODO parameterize the load path import_to_db(self.db_session, load_dir, drop=True) diff --git a/src/agent0/core/hyperdrive/interactive/local_hyperdrive.py b/src/agent0/core/hyperdrive/interactive/local_hyperdrive.py index c34fb7218..ee758be9a 100644 --- a/src/agent0/core/hyperdrive/interactive/local_hyperdrive.py +++ b/src/agent0/core/hyperdrive/interactive/local_hyperdrive.py @@ -408,9 +408,7 @@ def sync_database( backfill_progress_bar=progress_bar, ) - def _maybe_run_blocking_data_pipeline( - self, start_block: int | None = None, progress_bar: bool = False, force_init: bool = False - ) -> None: + def _maybe_run_blocking_data_pipeline(self, start_block: int | None = None, progress_bar: bool = False) -> None: # Checks the chain config to see if manual sync is on. Noop if it is. if not self.chain.config.manual_database_sync: self.sync_database(start_block, progress_bar)