Skip to content

Commit

Permalink
improve(xcom): validate key in XCom.set() to prevent empty strings
Browse files Browse the repository at this point in the history
  • Loading branch information
kiran2706 committed Feb 20, 2025
1 parent b95990b commit 29ad7c4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions airflow/models/xcom.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ def set(
"""
from airflow.models.dagrun import DagRun

if not key:
raise ValueError(f"XCom key must be a non-empty string. Received: {key}")

if not run_id:
raise ValueError(f"run_id must be passed. Passed run_id={run_id}")

Expand Down

0 comments on commit 29ad7c4

Please sign in to comment.