Skip to content

Commit af56db4

Browse files
committed
fix_sqlexception
1 parent 45cc685 commit af56db4

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

dags/common/quarantined_tests.py

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

1717
import dataclasses
1818
import fnmatch
19+
import logging
20+
import os
21+
import sqlite3
1922
from typing import Set
2023

2124
from airflow.models import Variable
@@ -52,6 +55,16 @@ def match_quarantine_patterns(
5255
return False
5356

5457

58+
def safe_get_from_variable(key: str, default_var: str):
59+
value = default_var
60+
is_CI = os.getenv("GITHUB_ACTIONS", "false").lower() == "true"
61+
if is_CI:
62+
logging.info("In GitHub Actions, skip")
63+
else:
64+
value = Variable.get(key, default_var=default_var)
65+
return value
66+
67+
5568
"""
5669
The quarantine list is defined by a set of UNIX Shell Glob Patterns.
5770
These patterns are used to match and quarantine tests.
@@ -63,7 +76,7 @@ def match_quarantine_patterns(
6376
- maxd-sdxl-* (Matches all 'maxd-sdxl-' tests)
6477
"""
6578
quarantine_patterns = parse_quarantine_patterns(
66-
Variable.get("quarantine_patterns", "")
79+
safe_get_from_variable("quarantine_patterns", "")
6780
)
6881

6982

0 commit comments

Comments
 (0)