From 48aa561ac326dcc36e4e10524016cc2974f00987 Mon Sep 17 00:00:00 2001 From: BryanFauble <17128019+BryanFauble@users.noreply.github.com> Date: Thu, 9 Jan 2025 12:25:45 -0700 Subject: [PATCH] delete staticmethod from delete_rows --- synapseclient/models/protocols/table_protocol.py | 4 +--- synapseclient/models/table.py | 6 ++---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/synapseclient/models/protocols/table_protocol.py b/synapseclient/models/protocols/table_protocol.py index a6db5121b..cf4c34515 100644 --- a/synapseclient/models/protocols/table_protocol.py +++ b/synapseclient/models/protocols/table_protocol.py @@ -110,9 +110,8 @@ def store_rows( """ return None - @staticmethod def delete_rows( - query: str, table_id: str, *, synapse_client: Optional[Synapse] = None + self, query: str, *, synapse_client: Optional[Synapse] = None ) -> pd.DataFrame: """ Delete rows from a table given a query to select rows. The query at a @@ -126,7 +125,6 @@ def delete_rows( must select the `ROW_ID` and `ROW_VERSION` columns. See this document that describes the expected syntax of the query: - table_id: The ID of the table to delete rows from. synapse_client: If not passed in and caching was not disabled by `Synapse.allow_client_caching(False)` this will use the last created instance from the Synapse class constructor. diff --git a/synapseclient/models/table.py b/synapseclient/models/table.py index 90f0c320a..db6f8b931 100644 --- a/synapseclient/models/table.py +++ b/synapseclient/models/table.py @@ -938,9 +938,8 @@ async def store_rows_async( raise NotImplementedError("This method is not yet implemented") - @staticmethod async def delete_rows_async( - query: str, table_id: str, *, synapse_client: Optional[Synapse] = None + self, query: str, *, synapse_client: Optional[Synapse] = None ) -> pd.DataFrame: """ Delete rows from a table given a query to select rows. The query at a @@ -954,7 +953,6 @@ async def delete_rows_async( must select the `ROW_ID` and `ROW_VERSION` columns. See this document that describes the expected syntax of the query: - table_id: The ID of the table to delete rows from. synapse_client: If not passed in and caching was not disabled by `Synapse.allow_client_caching(False)` this will use the last created instance from the Synapse class constructor. @@ -991,7 +989,7 @@ async def main(): None, lambda: delete_rows( syn=Synapse.get_client(synapse_client=synapse_client), - table_id=table_id, + table_id=self.id, row_id_vers_list=rows_to_delete, ), )