Skip to content

Commit

Permalink
add call to specifically drop the edges table
Browse files Browse the repository at this point in the history
  • Loading branch information
pattonw committed Aug 27, 2024
1 parent 2a8008f commit c6422e7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions funlib/persistence/graphs/pgsql_graph_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ def __init__(
edge_attrs=edge_attrs, # type: ignore
)

def _drop_edges(self) -> None:
logger.info("dropping edges table %s", self.edges_table_name)
self.__exec(f"DROP TABLE IF EXISTS {self.edges_table_name}")
self._commit()

def _drop_tables(self) -> None:
logger.info(
"dropping tables %s, %s",
Expand Down
4 changes: 4 additions & 0 deletions funlib/persistence/graphs/sql_graph_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ def get(value, default):
metadata = self.__create_metadata()
self._store_metadata(metadata)

@abstractmethod
def _drop_edges(self) -> None:
pass

@abstractmethod
def _drop_tables(self) -> None:
pass
Expand Down
4 changes: 4 additions & 0 deletions funlib/persistence/graphs/sqlite_graph_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ def edge_array_columns(self):
}
return self._edge_array_columns

def _drop_edges(self) -> None:
logger.info("dropping edges table %s", self.edges_table_name)
self.cur.execute(f"DROP TABLE IF EXISTS {self.edges_table_name}")

def _drop_tables(self) -> None:
logger.info(
"dropping collections %s, %s",
Expand Down

0 comments on commit c6422e7

Please sign in to comment.