|
3 | 3 | from __future__ import annotations |
4 | 4 |
|
5 | 5 | import logging |
6 | | -import re |
7 | 6 | from collections.abc import Sequence |
8 | 7 | from dataclasses import replace |
9 | 8 | from typing import Any, cast |
|
61 | 60 | InferredNullability, |
62 | 61 | ) |
63 | 62 | from sqlbuild.compiler.profiling.main.record import record_compile_timing |
64 | | -from sqlbuild.compiler.references.main._quoted_reference_call_pattern import ( |
65 | | - quoted_reference_call_pattern, |
66 | | -) |
67 | | -from sqlbuild.compiler.references.main.reference_call_prefix_pattern_text import ( |
68 | | - reference_call_prefix_pattern_text, |
69 | | -) |
70 | | -from sqlbuild.compiler.references.types import SqlReferenceKind |
71 | 63 | from sqlbuild.compiler.sql_analysis.constants import ( |
72 | 64 | POLYGLOT_ANALYSIS_BASE_TABLES as _POLYGLOT_ANALYSIS_BASE_TABLES, |
73 | 65 | ) |
|
175 | 167 | _LARGE_COMPACT_PROJECT_MODELS: int = 10_000 |
176 | 168 | _LARGE_COMPACT_SQL_BYTES: int = 48 * 1024 * 1024 |
177 | 169 | _NATIVE_LEGACY_FALLBACK: str = "native project type recovery requires legacy fallback" |
178 | | -_REF_PATTERN: re.Pattern[str] = quoted_reference_call_pattern(SqlReferenceKind.REF) |
179 | | -_SEED_PATTERN: re.Pattern[str] = quoted_reference_call_pattern(SqlReferenceKind.SEED) |
180 | | -_SOURCE_PATTERN: re.Pattern[str] = quoted_reference_call_pattern(SqlReferenceKind.SOURCE) |
181 | | -_DBT_REF_PATTERN: re.Pattern[str] = quoted_reference_call_pattern(SqlReferenceKind.DBT_REF) |
182 | | -_UDF_PATTERN: re.Pattern[str] = re.compile( |
183 | | - rf"{reference_call_prefix_pattern_text(SqlReferenceKind.UDF)}" |
184 | | - r'"([A-Za-z_][A-Za-z0-9_]*)"\)\s*(?=\()' |
185 | | -) |
186 | | -_TABLE_FUNCTION_PATTERN: re.Pattern[str] = re.compile( |
187 | | - rf"{reference_call_prefix_pattern_text(SqlReferenceKind.TABLE_FUNCTION)}" |
188 | | - r'"([A-Za-z_][A-Za-z0-9_]*)"\)\s*(?=\()' |
189 | | -) |
190 | | -_PLACEHOLDER_PATTERN: re.Pattern[str] = re.compile(r"@@@(\w+)") |
191 | 170 |
|
192 | 171 |
|
193 | 172 | def infer_columns_with_sql_analysis( |
|
0 commit comments