@@ -66,13 +66,7 @@ def add_dummy_requests(
66
66
def requests_cleaner (
67
67
connection_string : Optional [str ] = None , older_than_days : Optional [int ] = 365
68
68
) -> 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`."""
76
70
if not connection_string :
77
71
dbsettings = config .ensure_settings (config .dbsettings )
78
72
connection_string = dbsettings .connection_string
@@ -116,17 +110,10 @@ def requests_cleaner(
116
110
@app .command ()
117
111
def list_request_uids (
118
112
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" ),
122
115
) -> 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."""
130
117
with database .ensure_session_obj (None )() as session :
131
118
result = session .execute (
132
119
sa .text (f"select request_uid from system_requests where { query } " )
@@ -161,12 +148,7 @@ def delete_requests(
161
148
message : Optional [str ] = "The request has been dismissed by the administrator." ,
162
149
skip_confirmation : Annotated [bool , typer .Option ("--yes" , "-y" )] = False ,
163
150
) -> 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'."""
170
152
if not connection_string :
171
153
dbsettings = config .ensure_settings (config .dbsettings )
172
154
connection_string = dbsettings .connection_string
0 commit comments