Skip to content

Commit

Permalink
delete staticmethod from delete_rows
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanFauble committed Jan 9, 2025
1 parent fdc1b75 commit 48aa561
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions synapseclient/models/protocols/table_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
<https://rest-docs.synapse.org/rest/org/sagebionetworks/repo/web/controller/TableExamples.html>
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.
Expand Down
6 changes: 2 additions & 4 deletions synapseclient/models/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
<https://rest-docs.synapse.org/rest/org/sagebionetworks/repo/web/controller/TableExamples.html>
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.
Expand Down Expand Up @@ -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,
),
)
Expand Down

0 comments on commit 48aa561

Please sign in to comment.