Skip to content

Commit

Permalink
Use json values instead of Python in Airflow variables
Browse files Browse the repository at this point in the history
  • Loading branch information
augusto-herrmann committed Aug 22, 2024
1 parent 12bdc44 commit 862eebd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/parsers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Abstract and concrete classes to parse DAG configuration from a file."""

import ast
from dataclasses import dataclass
import json
import textwrap
from typing import List, Set, Tuple
import yaml
Expand Down Expand Up @@ -161,7 +161,7 @@ def _get_terms_params(self, search) -> Tuple[List[str], str, str]:
if "from_airflow_variable" in terms:
var_value = Variable.get(terms.get("from_airflow_variable"))
try:
terms = ast.literal_eval(var_value)
terms = json.loads(var_value)
except (ValueError, SyntaxError):
terms = var_value.splitlines()
elif "from_db_select" in terms:
Expand Down

0 comments on commit 862eebd

Please sign in to comment.