| Dependency | Reason |
|---|---|
| Dagrun Running | Task instance's dagrun was not in the 'running' state but in the state 'success'. |
| 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. |
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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | def getPaymentStatistics(**context):
token = context.get("ti").xcom_pull(key="token")
main_records = get_workflow_records(token, WORKFLOW_ID)
print(f"Total records fetched from main workflow: {len(main_records) if main_records else 0}")
if not main_records:
print("No records found in main workflow.")
return
final_stats_records = get_workflow_records(token, FINAL_STATS_WORKFLOW_ID)
print(f"Total records fetched from final stats workflow: {len(final_stats_records) if final_stats_records else 0}")
final_stats_lookup = build_final_stats_lookup(final_stats_records)
print(f"Final stats lookup rows prepared: {len(final_stats_lookup)}")
output_rows = []
matched_final_stats_count = 0
unmatched_ip_nos = []
for record in main_records:
row = extract_output_row(record)
ip_no = normalize_ip_no(row.get("ip_no"))
final_stats = final_stats_lookup.get(ip_no)
if final_stats:
row["final_total_of_the_price_with_pain"] = final_stats.get("final_total_of_the_price_with_pain")
row["final_total_of_the_price"] = final_stats.get("final_total_of_the_price")
matched_final_stats_count += 1
else:
unmatched_ip_nos.append(ip_no)
output_rows.append(row)
print("\n===== SAMPLE OUTPUT ROW (PAYMENT STATISTICS) =====")
print(json.dumps(output_rows[:1], indent=2, default=str))
print(f"Matched final stats rows: {matched_final_stats_count}")
print(f"Unmatched IP nos count: {len(unmatched_ip_nos)}")
if unmatched_ip_nos:
print("Sample unmatched IP nos:", unmatched_ip_nos[:10])
df = pd.DataFrame(output_rows)
engine = get_postgres_connection()
df.to_sql(
TARGET_TABLE,
engine,
if_exists="replace",
index=False
)
print(f"Inserted {len(df)} rows into {TARGET_TABLE}")
|
| Attribute | Value |
|---|---|
| dag_id | ssh505-scc |
| duration | 3.119518 |
| end_date | 2026-04-24 07:00:48.633093+00:00 |
| execution_date | 2026-04-23T15:00:00+00:00 |
| executor_config | {} |
| generate_command | <function TaskInstance.generate_command at 0x7fd0919c9320> |
| hostname | c8820bd82d81 |
| is_premature | False |
| job_id | 19298 |
| key | ('ssh505-scc', 'getPaymentStatistics', <Pendulum [2026-04-23T15:00:00+00:00]>, 2) |
| log | <Logger airflow.task (INFO)> |
| log_filepath | /usr/local/airflow/logs/ssh505-scc/getPaymentStatistics/2026-04-23T15:00:00+00:00.log |
| log_url | http://localhost:8080/admin/airflow/log?execution_date=2026-04-23T15%3A00%3A00%2B00%3A00&task_id=getPaymentStatistics&dag_id=ssh505-scc |
| logger | <Logger airflow.task (INFO)> |
| mark_success_url | http://localhost:8080/success?task_id=getPaymentStatistics&dag_id=ssh505-scc&execution_date=2026-04-23T15%3A00%3A00%2B00%3A00&upstream=false&downstream=false |
| max_tries | 1 |
| metadata | MetaData(bind=None) |
| next_try_number | 2 |
| operator | PythonOperator |
| pid | 2086837 |
| pool | default_pool |
| prev_attempted_tries | 1 |
| previous_execution_date_success | 2026-04-23 07:00:00+00:00 |
| previous_start_date_success | 2026-04-23 15:02:08.768780+00:00 |
| previous_ti | <TaskInstance: ssh505-scc.getPaymentStatistics 2026-04-23 07:00:00+00:00 [success]> |
| previous_ti_success | <TaskInstance: ssh505-scc.getPaymentStatistics 2026-04-23 07:00:00+00:00 [success]> |
| priority_weight | 1 |
| queue | default |
| queued_dttm | 2026-04-24 07:00:39.701265+00:00 |
| raw | False |
| run_as_user | None |
| start_date | 2026-04-24 07:00:45.513575+00:00 |
| state | success |
| task | <Task(PythonOperator): getPaymentStatistics> |
| task_id | getPaymentStatistics |
| test_mode | False |
| try_number | 2 |
| unixname | airflow |
| Attribute | Value |
|---|---|
| dag | <DAG: ssh505-scc> |
| dag_id | ssh505-scc |
| depends_on_past | False |
| deps | {<TIDep(Trigger Rule)>, <TIDep(Not In Retry Period)>, <TIDep(Previous Dagrun State)>} |
| do_xcom_push | True |
| downstream_list | [] |
| downstream_task_ids | set() |
| 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 | 1 |
| 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 | getPaymentStatistics |
| 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 |