civis.utils.job_logs

civis.utils.job_logs(job_id, run_id=None, finished_timeout=None)[source]

Return a generator of log message dictionaries for a given run.

Parameters:
job_idint

The ID of the job to retrieve log message for.

run_idint or None

The ID of the run to retrieve log messages for. If None, the ID for the most recent run will be used.

finished_timeout: int or None

If not None, then this function will return once the run has been finished for the specified number of seconds. If None, then this function will wait until the API says there will be no more new log messages, which may take a few minutes. A timeout of 30-60 seconds is usually enough to retrieve all log messages.

Yields:
dict

A log message dictionary with “message”, “createdAt” and other attributes provided by the job logs endpoint. Note that this will block execution until the job has stopped and all log messages are retrieved.