You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a DAG is triggered using the astro run <dag_id> command and variable imported from airflow_settings.yaml, it fails with the error:
FAILED ❌ can only concatenate str (not "Variable") to str.
However, the same DAG runs successfully when triggered from the Airflow UI or using the airflow dags trigger <dag_id> command.
What CLI Version did you experience this bug?
1.30.0
This CLI bug is related to which Astronomer Platform?
[ X ] Astro
Software
None/Unknown
What Operating System is the above CLI installed on?
🪜 Steps To Reproduce
Add a variable in airflow_settings.yaml.
Use the variable in a DAG task. For example:
from airflow import DAG
from airflow.operators.python import PythonOperator
from datetime import datetime
# Define the Python function to be executed
def read_variable():
from airflow.models import Variable
bucket_name = Variable.get("default_s3_bucket")
print('*' + bucket_name + '*')
# Default arguments for the DAG
default_args = {
'owner': 'airflow',
'retries': 1,
}
# Instantiate the DAG
with DAG(
dag_id='simple_python_operator_dag',
default_args=default_args,
start_date=datetime(2024, 1, 1),
schedule_interval='@daily', # Runs daily
catchup=False,
) as dag:
read_variable = PythonOperator(
task_id="read_variable",
python_callable=read_variable
)
Trigger the DAG using the astro run <dag_id> command from the local environment.
The text was updated successfully, but these errors were encountered:
Describe the bug
When a DAG is triggered using the astro run <dag_id> command and variable imported from
airflow_settings.yaml
, it fails with the error:However, the same DAG runs successfully when triggered from the Airflow UI or using the airflow dags trigger <dag_id> command.
What CLI Version did you experience this bug?
1.30.0
This CLI bug is related to which Astronomer Platform?
What Operating System is the above CLI installed on?
🪜 Steps To Reproduce
The text was updated successfully, but these errors were encountered: