| Dependency | Reason |
|---|---|
| Task Instance State | Task is in the 'success' state which is not a valid state for execution. The task must be cleared in order to be run. |
| Dagrun Running | Task instance's dagrun was not in the 'running' state but in the state 'success'. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | def getProgrammeData(**context):
token = context.get("ti").xcom_pull(key="token")
response = requests.get(
url=f"{dRoW_api_end_url}/api/sheets/63fd698ed6779f0c607a677c?with_records=true&fields=",
headers={"x-access-token": f"Bearer {token}"}
)
sheet = json.loads(response.text)
records = sheet["record"]
target_col = "Programme Approval Elapsed Time (days)"
latest_id = -1
latest_elapsed_time = None
for record in records:
# Build column map for easy access
col_map = {v["colName"]: v.get("value") for v in record.get("values", [])}
raw_id = col_map.get("id")
if raw_id is None:
continue
try:
numeric_id = int(raw_id)
except ValueError:
continue
# If this is the largest id so far → update answer
if numeric_id > latest_id:
latest_id = numeric_id
latest_elapsed_time = col_map.get(target_col)
print(f"Largest Programme ID = {latest_id}")
print(f"Elapsed Time = {latest_elapsed_time}")
context["ti"].xcom_push(key="kpi_1", value=latest_elapsed_time)
return latest_elapsed_time
|
| Attribute | Value |
|---|---|
| dag_id | nd201905_kpi |
| duration | 0.535322 |
| end_date | 2025-12-11 04:10:55.628194+00:00 |
| execution_date | 2025-12-11T04:09:37.519408+00:00 |
| executor_config | {} |
| generate_command | <function TaskInstance.generate_command at 0x7fb2f39d0320> |
| hostname | 406be32ba58f |
| is_premature | False |
| job_id | 802 |
| key | ('nd201905_kpi', 'getProgrammeData', <Pendulum [2025-12-11T04:09:37.519408+00:00]>, 2) |
| log | <Logger airflow.task (INFO)> |
| log_filepath | /usr/local/airflow/logs/nd201905_kpi/getProgrammeData/2025-12-11T04:09:37.519408+00:00.log |
| log_url | http://localhost:8080/admin/airflow/log?execution_date=2025-12-11T04%3A09%3A37.519408%2B00%3A00&task_id=getProgrammeData&dag_id=nd201905_kpi |
| logger | <Logger airflow.task (INFO)> |
| mark_success_url | http://localhost:8080/success?task_id=getProgrammeData&dag_id=nd201905_kpi&execution_date=2025-12-11T04%3A09%3A37.519408%2B00%3A00&upstream=false&downstream=false |
| max_tries | 1 |
| metadata | MetaData(bind=None) |
| next_try_number | 2 |
| operator | PythonOperator |
| pid | 716603 |
| pool | default_pool |
| prev_attempted_tries | 1 |
| previous_execution_date_success | 2025-12-11 03:54:29.510399+00:00 |
| previous_start_date_success | 2025-12-11 03:55:25.135614+00:00 |
| previous_ti | <TaskInstance: nd201905_kpi.getProgrammeData 2025-12-11 03:54:29.510399+00:00 [success]> |
| previous_ti_success | <TaskInstance: nd201905_kpi.getProgrammeData 2025-12-11 03:54:29.510399+00:00 [success]> |
| priority_weight | 2 |
| queue | default |
| queued_dttm | 2025-12-11 04:10:51.034375+00:00 |
| raw | False |
| run_as_user | None |
| start_date | 2025-12-11 04:10:55.092872+00:00 |
| state | success |
| task | <Task(PythonOperator): getProgrammeData> |
| task_id | getProgrammeData |
| test_mode | False |
| try_number | 2 |
| unixname | airflow |
| Attribute | Value |
|---|---|
| dag | <DAG: nd201905_kpi> |
| dag_id | nd201905_kpi |
| depends_on_past | False |
| deps | {<TIDep(Trigger Rule)>, <TIDep(Previous Dagrun State)>, <TIDep(Not In Retry Period)>} |
| do_xcom_push | True |
| downstream_list | [<Task(PythonOperator): getContractData>] |
| downstream_task_ids | {'getContractData'} |
| None | |
| email_on_failure | True |
| email_on_retry | True |
| end_date | None |
| execution_timeout | None |
| executor_config | {} |
| extra_links | [] |
| global_operator_extra_link_dict | {} |
| inlets | [] |
| lineage_data | None |
| log | <Logger airflow.task.operators (INFO)> |
| logger | <Logger airflow.task.operators (INFO)> |
| max_retry_delay | None |
| on_failure_callback | None |
| on_retry_callback | None |
| on_success_callback | None |
| op_args | [] |
| op_kwargs | {} |
| operator_extra_link_dict | {} |
| operator_extra_links | () |
| outlets | [] |
| owner | airflow |
| params | {} |
| pool | default_pool |
| priority_weight | 1 |
| priority_weight_total | 4 |
| provide_context | True |
| queue | default |
| resources | None |
| retries | 1 |
| retry_delay | 0:05:00 |
| retry_exponential_backoff | False |
| run_as_user | None |
| schedule_interval | 0 7,15 * * * |
| shallow_copy_attrs | ('python_callable', 'op_kwargs') |
| sla | None |
| start_date | 2023-01-17T00:00:00+00:00 |
| subdag | None |
| task_concurrency | None |
| task_id | getProgrammeData |
| task_type | PythonOperator |
| template_ext | [] |
| template_fields | ('templates_dict', 'op_args', 'op_kwargs') |
| templates_dict | None |
| trigger_rule | all_success |
| ui_color | #ffefeb |
| ui_fgcolor | #000 |
| upstream_list | [<Task(PythonOperator): getDrowToken>] |
| upstream_task_ids | {'getDrowToken'} |
| wait_for_downstream | False |
| weight_rule | downstream |