Skip to content

Commit 2768a72

Browse files
qa
1 parent f796291 commit 2768a72

File tree

1 file changed

+5
-23
lines changed

1 file changed

+5
-23
lines changed

cads_broker/entry_points.py

+5-23
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,7 @@ def add_dummy_requests(
6666
def requests_cleaner(
6767
connection_string: Optional[str] = None, older_than_days: Optional[int] = 365
6868
) -> None:
69-
"""Remove records from the system_requests table older than `older_than_days`.
70-
71-
Parameters
72-
----------
73-
connection_string: something like 'postgresql://user:password@netloc:port/dbname'
74-
older_than_days: minimum age (in days) to consider a record to be removed
75-
"""
69+
"""Remove records from the system_requests table older than `older_than_days`."""
7670
if not connection_string:
7771
dbsettings = config.ensure_settings(config.dbsettings)
7872
connection_string = dbsettings.connection_string
@@ -116,17 +110,10 @@ def requests_cleaner(
116110
@app.command()
117111
def list_request_uids(
118112
query: str,
119-
output_file: Annotated[Path, typer.Argument(file_okay=True, dir_okay=False)] = Path(
120-
"request_uids.txt"
121-
),
113+
output_file: Annotated[Path, typer.Argument(file_okay=True, dir_okay=False)]
114+
| None = Path("request_uids.txt"),
122115
) -> None:
123-
"""List request_uids from the system_requests table.
124-
125-
Parameters
126-
----------
127-
query: SQL query to filter the request_uids
128-
output_file: file to write the request_uids
129-
"""
116+
"""List request_uids from the system_requests table."""
130117
with database.ensure_session_obj(None)() as session:
131118
result = session.execute(
132119
sa.text(f"select request_uid from system_requests where {query}")
@@ -161,12 +148,7 @@ def delete_requests(
161148
message: Optional[str] = "The request has been dismissed by the administrator.",
162149
skip_confirmation: Annotated[bool, typer.Option("--yes", "-y")] = False,
163150
) -> None:
164-
"""Set the status of records in the system_requests table to 'dismissed'.
165-
166-
Parameters
167-
----------
168-
connection_string: something like 'postgresql://user:password@netloc:port/dbname'
169-
"""
151+
"""Set the status of records in the system_requests table to 'dismissed'."""
170152
if not connection_string:
171153
dbsettings = config.ensure_settings(config.dbsettings)
172154
connection_string = dbsettings.connection_string

0 commit comments

Comments
 (0)