duckguard 3.0.1__py3-none-any.whl → 3.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- duckguard/__init__.py +1 -1
- duckguard/ai/__init__.py +33 -0
- duckguard/ai/config.py +201 -0
- duckguard/ai/explainer.py +109 -0
- duckguard/ai/fixer.py +105 -0
- duckguard/ai/natural_language.py +119 -0
- duckguard/ai/rules_generator.py +121 -0
- duckguard/checks/conditional.py +4 -3
- duckguard/cli/main.py +480 -93
- duckguard/core/column.py +15 -5
- duckguard/core/result.py +35 -14
- duckguard/profiler/auto_profile.py +217 -64
- duckguard/py.typed +0 -0
- duckguard/reports/html_reporter.py +522 -37
- duckguard/reports/pdf_reporter.py +33 -5
- duckguard/semantic/detector.py +18 -7
- duckguard-3.2.0.dist-info/METADATA +1206 -0
- {duckguard-3.0.1.dist-info → duckguard-3.2.0.dist-info}/RECORD +22 -14
- duckguard-3.2.0.dist-info/licenses/LICENSE +190 -0
- duckguard-3.2.0.dist-info/licenses/NOTICE +7 -0
- duckguard-3.0.1.dist-info/METADATA +0 -1072
- duckguard-3.0.1.dist-info/licenses/LICENSE +0 -55
- {duckguard-3.0.1.dist-info → duckguard-3.2.0.dist-info}/WHEEL +0 -0
- {duckguard-3.0.1.dist-info → duckguard-3.2.0.dist-info}/entry_points.txt +0 -0
duckguard/checks/conditional.py
CHANGED
|
@@ -609,9 +609,9 @@ class ConditionalCheckHandler:
|
|
|
609
609
|
# Normalize path for DuckDB (forward slashes work on all platforms)
|
|
610
610
|
source_path = dataset._source.replace('\\', '/')
|
|
611
611
|
|
|
612
|
-
# Format allowed values for SQL IN clause
|
|
612
|
+
# Format allowed values for SQL IN clause (with proper escaping)
|
|
613
613
|
if isinstance(allowed_values[0], str):
|
|
614
|
-
values_str = ", ".join(f"'{v}'" for v in allowed_values)
|
|
614
|
+
values_str = ", ".join(f"'{v.replace(chr(39), chr(39)+chr(39))}'" for v in allowed_values)
|
|
615
615
|
else:
|
|
616
616
|
values_str = ", ".join(str(v) for v in allowed_values)
|
|
617
617
|
|
|
@@ -701,11 +701,12 @@ class ConditionalCheckHandler:
|
|
|
701
701
|
# Normalize path for DuckDB (forward slashes work on all platforms)
|
|
702
702
|
source_path = dataset._source.replace('\\', '/')
|
|
703
703
|
|
|
704
|
+
safe_pattern = pattern.replace("'", "''")
|
|
704
705
|
sql = f"""
|
|
705
706
|
SELECT COUNT(*) as violations
|
|
706
707
|
FROM '{source_path}'
|
|
707
708
|
WHERE ({condition})
|
|
708
|
-
AND NOT regexp_matches({column}::VARCHAR, '{
|
|
709
|
+
AND NOT regexp_matches({column}::VARCHAR, '{safe_pattern}')
|
|
709
710
|
"""
|
|
710
711
|
|
|
711
712
|
try:
|