@@ -27,13 +27,15 @@ def store_new_user_conversation(
2727 session.
2828
2929 Parameters:
30+ ----------
3031 session (Session): SQLAlchemy session used to persist the record.
3132 id (Optional[str]): Optional explicit ID to assign to the new conversation.
3233 If not provided, a generated suid will be used.
3334 user_id (Optional[str]): Optional explicit user ID to assign to the new
3435 conversation. If not provided, a generated suid will be used.
3536
3637 Returns:
38+ -------
3739 None
3840 """
3941 provider = generate_provider ()
@@ -60,10 +62,12 @@ def update_user_conversation(session: Session, id: str) -> None:
6062 session.
6163
6264 Parameters:
65+ ----------
6366 session (Session): SQLAlchemy session used to persist the record.
6467 id (str): Explicit ID to assign to the new conversation.
6568
6669 Returns:
70+ -------
6771 None
6872 """
6973 provider = generate_provider ()
@@ -89,9 +93,11 @@ def list_conversation_for_all_users(session: Session) -> None:
8993 that measures the listing performance.
9094
9195 Parameters:
96+ ----------
9297 session (Session): SQLAlchemy session used to query conversations.
9398
9499 Returns:
100+ -------
95101 None
96102 """
97103 query = session .query (UserConversation )
@@ -110,9 +116,11 @@ def retrieve_conversation(
110116 is intended for use in a benchmark that measures the listing performance.
111117
112118 Parameters:
119+ ----------
113120 session (Session): SQLAlchemy session used to query conversations.
114121
115122 Returns:
123+ -------
116124 None
117125 """
118126 query = session .query (UserConversation ).filter_by (id = conversation_id )
@@ -133,9 +141,11 @@ def retrieve_conversation_for_one_user(
133141 is intended for use in a benchmark that measures the listing performance.
134142
135143 Parameters:
144+ ----------
136145 session (Session): SQLAlchemy session used to query conversations.
137146
138147 Returns:
148+ -------
139149 None
140150 """
141151 query = session .query (UserConversation ).filter_by (
@@ -157,9 +167,11 @@ def list_conversation_for_one_user(session: Session, user_id: str) -> None:
157167 that measures the listing performance.
158168
159169 Parameters:
170+ ----------
160171 session (Session): SQLAlchemy session used to query conversations.
161172
162173 Returns:
174+ -------
163175 None
164176 """
165177 query = session .query (UserConversation ).filter_by (user_id = user_id )
@@ -178,10 +190,12 @@ def benchmark_store_new_user_conversations(
178190 benchmark task stores one more conversation (using the helper above).
179191
180192 Parameters:
193+ ----------
181194 benchmark (BenchmarkFixture): pytest-benchmark fixture to run the measurement.
182195 records_to_insert (int): Number of records to pre-populate before benchmarking.
183196
184197 Returns:
198+ -------
185199 None
186200 """
187201 with get_session () as session :
@@ -202,10 +216,12 @@ def benchmark_update_user_conversation(
202216 and then benchmarks updating that conversation.
203217
204218 Parameters:
219+ ----------
205220 benchmark (BenchmarkFixture): pytest-benchmark fixture to run the measurement.
206221 records_to_insert (int): Number of records to pre-populate before benchmarking.
207222
208223 Returns:
224+ -------
209225 None
210226 """
211227 with get_session () as session :
@@ -232,10 +248,12 @@ def benchmark_list_conversations_for_all_users(
232248 the performance of querying and retrieving all UserConversation rows.
233249
234250 Parameters:
251+ ----------
235252 benchmark (BenchmarkFixture): pytest-benchmark fixture to run the measurement.
236253 records_to_insert (int): Number of records to pre-populate before benchmarking.
237254
238255 Returns:
256+ -------
239257 None
240258 """
241259 with get_session () as session :
@@ -255,10 +273,12 @@ def benchmark_list_conversations_for_one_user(
255273 the performance of querying and retrieving all UserConversation rows.
256274
257275 Parameters:
276+ ----------
258277 benchmark (BenchmarkFixture): pytest-benchmark fixture to run the measurement.
259278 records_to_insert (int): Number of records to pre-populate before benchmarking.
260279
261280 Returns:
281+ -------
262282 None
263283 """
264284 with get_session () as session :
@@ -281,10 +301,12 @@ def benchmark_retrieve_conversation(
281301 the performance of querying and retrieving one UserConversation record.
282302
283303 Parameters:
304+ ----------
284305 benchmark (BenchmarkFixture): pytest-benchmark fixture to run the measurement.
285306 records_to_insert (int): Number of records to pre-populate before benchmarking.
286307
287308 Returns:
309+ -------
288310 None
289311 """
290312 with get_session () as session :
@@ -309,10 +331,12 @@ def benchmark_retrieve_conversation_for_one_user(
309331 the performance of querying and retrieving one UserConversation record.
310332
311333 Parameters:
334+ ----------
312335 benchmark (BenchmarkFixture): pytest-benchmark fixture to run the measurement.
313336 records_to_insert (int): Number of records to pre-populate before benchmarking.
314337
315338 Returns:
339+ -------
316340 None
317341 """
318342 with get_session () as session :
0 commit comments