@@ -193,8 +193,7 @@ async def list_jobs(
193
193
ascending order.
194
194
:return: A list of job list items, if empty then no jobs were found.
195
195
"""
196
- client = ctx .session .state ["sapi_client" ]
197
- assert isinstance (client , KeboolaClient )
196
+ client = KeboolaClient .from_state (ctx .session .state )
198
197
199
198
status = handle_status_param (status = status )
200
199
@@ -218,8 +217,7 @@ async def get_job_details(
218
217
:param job_id: The unique identifier of the job whose details should be retrieved.
219
218
:return: A job detail object
220
219
"""
221
- client = ctx .session .state ["sapi_client" ]
222
- assert isinstance (client , KeboolaClient )
220
+ client = KeboolaClient .from_state (ctx .session .state )
223
221
224
222
r_job = client .jobs_queue .detail (job_id )
225
223
logger .info (f"Found job details for { job_id } ." if r_job else f"Job { job_id } not found." )
@@ -274,8 +272,7 @@ async def list_component_config_jobs(
274
272
ascending order.
275
273
:return: A list of job list items.
276
274
"""
277
- client = ctx .session .state ["sapi_client" ]
278
- assert isinstance (client , KeboolaClient )
275
+ client = KeboolaClient .from_state (ctx .session .state )
279
276
280
277
status = handle_status_param (status = status )
281
278
params = {
@@ -336,8 +333,7 @@ async def list_component_jobs(
336
333
order.
337
334
:return: A list of job list items.
338
335
"""
339
- client = ctx .session .state ["sapi_client" ]
340
- assert isinstance (client , KeboolaClient )
336
+ client = KeboolaClient .from_state (ctx .session .state )
341
337
342
338
status = handle_status_param (status = status )
343
339
params = {
0 commit comments