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 running with a scheduler this part of the code results in failed tasks for me with the following error:
MAX_LOG_AGE_IN_DAYS="{{dag_run.conf.maxLogAgeInDays}}"
if [ "${MAX_LOG_AGE_IN_DAYS}" == "" ]; then
echo "maxLogAgeInDays conf variable isn't included. Using Default '""" + str(DEFAULT_MAX_LOG_AGE_IN_DAYS) + """'."
MAX_LOG_AGE_IN_DAYS='""" + str(DEFAULT_MAX_LOG_AGE_IN_DAYS) + """'
fi
Error message: 'dict object' has no attribute 'maxLogAgeInDays'
It seems that the dag does not find the entry maxLogAgeInDays.
I wanted to ask where this value should be set? Following the readme, I only created two variables called airflow_log_cleanup__max_log_age_in_days and airflow_log_cleanup__enable_delete_child_log which are getting called for setting the variables DEFAULT_MAX_LOG_AGE_IN_DAYS and ENABLE_DELETE_CHILD_LOG.
I managed to get it to work by substituting the whole code above by:
Since the DEFAULT_MAX_LOG_AGE_IN_DAYS already reads out the variable set in the UI, I do not need dag_run.conf.maxLogAgeInDays, right?
In general, I would suggest to rename DEFAULT_MAX_LOG_AGE_IN_DAYS to MAX_LOG_AGE_IN_DAYS, because the variable is not the default, but the 30 in the .get() is:
One more thing:
Following best practices it would be better to combine the two variables to a single Variable in the JSON format to reduce DB requests:
When running with a scheduler this part of the code results in failed tasks for me with the following error:
Error message:
'dict object' has no attribute 'maxLogAgeInDays'
It seems that the dag does not find the entry
maxLogAgeInDays
.I wanted to ask where this value should be set? Following the readme, I only created two variables called
airflow_log_cleanup__max_log_age_in_days
andairflow_log_cleanup__enable_delete_child_log
which are getting called for setting the variablesDEFAULT_MAX_LOG_AGE_IN_DAYS
andENABLE_DELETE_CHILD_LOG
.I managed to get it to work by substituting the whole code above by:
Since the
DEFAULT_MAX_LOG_AGE_IN_DAYS
already reads out the variable set in the UI, I do not needdag_run.conf.maxLogAgeInDays
, right?In general, I would suggest to rename
DEFAULT_MAX_LOG_AGE_IN_DAYS
toMAX_LOG_AGE_IN_DAYS
, because the variable is not the default, but the30
in the.get()
is:One more thing:
Following best practices it would be better to combine the two variables to a single Variable in the JSON format to reduce DB requests:
I am using AirFlow 2.0.1
The text was updated successfully, but these errors were encountered: