Skip to content

Commit bd0bc4d

Browse files
committed
fix_sqlexception
1 parent 45cc685 commit bd0bc4d

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

dags/common/quarantined_tests.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
import dataclasses
1818
import fnmatch
19+
import logging
20+
import os
1921
from typing import Set
2022

2123
from airflow.models import Variable
@@ -52,6 +54,16 @@ def match_quarantine_patterns(
5254
return False
5355

5456

57+
def safe_get_from_variable(key: str, default_var: str):
58+
value = default_var
59+
is_CI = os.getenv("GITHUB_ACTIONS", "false").lower() == "true"
60+
if is_CI:
61+
logging.info("In GitHub Actions, skip")
62+
else:
63+
value = Variable.get(key, default_var=default_var)
64+
return value
65+
66+
5567
"""
5668
The quarantine list is defined by a set of UNIX Shell Glob Patterns.
5769
These patterns are used to match and quarantine tests.
@@ -63,7 +75,7 @@ def match_quarantine_patterns(
6375
- maxd-sdxl-* (Matches all 'maxd-sdxl-' tests)
6476
"""
6577
quarantine_patterns = parse_quarantine_patterns(
66-
Variable.get("quarantine_patterns", "")
78+
safe_get_from_variable("quarantine_patterns", "")
6779
)
6880

6981

0 commit comments

Comments
 (0)