Skip to content

Commit

Permalink
Allow AIRFLOW_VAR_DEV_LIMIT to be undefined
Browse files Browse the repository at this point in the history
When I removel `AIRFLOW_VAR_DEV_LIMIT` from my `.env` I got a DAG load
error when Airflow started up because it was trying to turn the empty
string into an int.
  • Loading branch information
edsu committed Feb 6, 2025
1 parent dc86d44 commit 8588fc6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rialto_airflow/dags/harvest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
sul_pub_key = Variable.get("sul_pub_key")

# to artificially limit the API activity in development
dev_limit = Variable.get("dev_limit", default_var=None)
if dev_limit is not None:
dev_limit = int(dev_limit)
try:
dev_limit = int(Variable.get("dev_limit", default_var=None))
except ValueError:
dev_limit = None


@dag(
Expand Down

0 comments on commit 8588fc6

Please sign in to comment.