Skip to content

Commit 3d42e93

Browse files
committed
refactor: remove test-only Python scheduler and unused private constants
1 parent ca7333f commit 3d42e93

20 files changed

Lines changed: 128 additions & 397 deletions

File tree

‎src/sqlbuild/cli/commands/_helpers/compile/target_writer.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@
5252
from sqlbuild.runtime.observability.classes.operation_lifecycle import OperationLifecycle
5353

5454
_COMPILED_DIR: str = "compiled"
55-
_RUN_DIR: str = "run"
5655
_MODELS_DIR: str = "models"
5756
_FUNCTIONS_DIR: str = "functions"
58-
_SQL_FUNCTIONS_DIR: str = "sql"
5957
_AUDITS_DIR: str = "audits"
6058
_GENERIC_DIR: str = "generic"
6159
_SINGULAR_DIR: str = "singular"

‎src/sqlbuild/cli/commands/_helpers/scenario_execution/runner.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@
8383
)
8484

8585
_SCENARIO_NAME_WIDTH: int = 64
86-
_EXPECTATION_LABEL_WIDTH: int = 10
87-
_EXPECTATION_NAME_WIDTH: int = 50
8886
_CAPTURE_RELATION_KIND_WIDTH: int = 8
8987
_CAPTURE_RELATION_NAME_WIDTH: int = _SCENARIO_NAME_WIDTH - 4 - _CAPTURE_RELATION_KIND_WIDTH - 1
9088

‎src/sqlbuild/cli/commands/classes/build_progress_callbacks.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
from sqlbuild.spec.contracts.models import SourceEntry
6363

6464
_TYPE_WIDTH: int = 10
65-
_MAX_NAME_WIDTH: int = 60
6665
_MIN_NAME_WIDTH: int = 20
6766
_NAME_PADDING: int = 2
6867
_SUB_INDENT: int = 2

‎src/sqlbuild/cli/output/_helpers/execution_result_document.py‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,6 @@
6767
from sqlbuild.virtual.executor.models import VirtualCloneResult
6868

6969
_JSON_VERSION: int = 1
70-
_SUCCESS_STATUS: str = "success"
71-
_FAILED_STATUS: str = "failed"
72-
_SKIPPED_STATUS: str = "skipped"
73-
_WARNING_STATUS: str = "warning"
74-
_WARN_STATUS: str = "warn"
7570
_SCENARIO_RESOURCE_NAMESPACE: ContextVar[str | None] = ContextVar(
7671
"sqlbuild_scenario_resource_namespace", default=None
7772
)

‎src/sqlbuild/compiler/compile/_helpers/analysis/compact.py‎

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from __future__ import annotations
44

55
import logging
6-
import re
76
from collections.abc import Sequence
87
from dataclasses import replace
98
from typing import Any, cast
@@ -61,13 +60,6 @@
6160
InferredNullability,
6261
)
6362
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
7163
from sqlbuild.compiler.sql_analysis.constants import (
7264
POLYGLOT_ANALYSIS_BASE_TABLES as _POLYGLOT_ANALYSIS_BASE_TABLES,
7365
)
@@ -175,19 +167,6 @@
175167
_LARGE_COMPACT_PROJECT_MODELS: int = 10_000
176168
_LARGE_COMPACT_SQL_BYTES: int = 48 * 1024 * 1024
177169
_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+)")
191170

192171

193172
def infer_columns_with_sql_analysis(

‎src/sqlbuild/compiler/compile/_helpers/attachment/audits.py‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,6 @@ def remember_scoped_declarations(
9393
self.scoped_declarations[key] = declarations
9494

9595

96-
_MODEL_HOOK_KEYS: frozenset[str] = frozenset({"pre_hooks", "post_hooks"})
97-
_HOOK_CONTEXT_PARAMETER_NAMES: frozenset[str] = frozenset(
98-
{"ctx", "context", "_ctx", "hook_context"}
99-
)
100-
101-
10296
def build_audit_inputs(
10397
*,
10498
discovered_inputs: DiscoveredProjectInputs,

‎src/sqlbuild/compiler/compile/_helpers/attachment/functions.py‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from __future__ import annotations
44

5-
import re
65
from dataclasses import dataclass
76
from pathlib import Path
87
from typing import Any, cast
@@ -79,13 +78,6 @@ class _PythonFunctionBuildContext:
7978
python_functions_inherit_default_namespace: bool
8079

8180

82-
_HOOK_TEMPLATE_PATTERN: re.Pattern[str] = re.compile(r"\$\{[^}]+\}")
83-
_MODEL_HOOK_KEYS: frozenset[str] = frozenset({"pre_hooks", "post_hooks"})
84-
_HOOK_CONTEXT_PARAMETER_NAMES: frozenset[str] = frozenset(
85-
{"ctx", "context", "_ctx", "hook_context"}
86-
)
87-
88-
8981
def build_sql_function_inputs(
9082
*,
9183
discovered_inputs: DiscoveredProjectInputs,

‎src/sqlbuild/compiler/compile/_helpers/attachment/references.py‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
from __future__ import annotations
44

5-
import re
6-
75
from sqlbuild.compiler.compile.constants import TABLE_FUNCTION_RETURN_KEYS
86
from sqlbuild.compiler.compile.exceptions import CompileInputError
97
from sqlbuild.compiler.compile.models import (
@@ -19,12 +17,6 @@
1917
)
2018
from sqlbuild.compiler.references.types import ExternalSqlReferenceResolver, SqlReferenceKind
2119

22-
_HOOK_TEMPLATE_PATTERN: re.Pattern[str] = re.compile(r"\$\{[^}]+\}")
23-
_MODEL_HOOK_KEYS: frozenset[str] = frozenset({"pre_hooks", "post_hooks"})
24-
_HOOK_CONTEXT_PARAMETER_NAMES: frozenset[str] = frozenset(
25-
{"ctx", "context", "_ctx", "hook_context"}
26-
)
27-
2820

2921
def validate_model_references(
3022
*,

‎src/sqlbuild/compiler/compile/_helpers/attachment/sources.py‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from __future__ import annotations
44

5-
import re
65
from dataclasses import replace
76
from pathlib import Path
87
from typing import cast
@@ -38,12 +37,6 @@
3837
SourceEntry,
3938
)
4039

41-
_HOOK_TEMPLATE_PATTERN: re.Pattern[str] = re.compile(r"\$\{[^}]+\}")
42-
_MODEL_HOOK_KEYS: frozenset[str] = frozenset({"pre_hooks", "post_hooks"})
43-
_HOOK_CONTEXT_PARAMETER_NAMES: frozenset[str] = frozenset(
44-
{"ctx", "context", "_ctx", "hook_context"}
45-
)
46-
4740

4841
def build_source_inputs(
4942
*,

‎src/sqlbuild/compiler/compile/_helpers/attachment/sql_tests.py‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from __future__ import annotations
44

5-
import re
65
from dataclasses import dataclass, replace
76
from pathlib import Path
87

@@ -76,12 +75,6 @@
7675
)
7776
from sqlbuild.compiler.scopes.types import ResourceKind, ScopeKind, UsageKind
7877

79-
_HOOK_TEMPLATE_PATTERN: re.Pattern[str] = re.compile(r"\$\{[^}]+\}")
80-
_MODEL_HOOK_KEYS: frozenset[str] = frozenset({"pre_hooks", "post_hooks"})
81-
_HOOK_CONTEXT_PARAMETER_NAMES: frozenset[str] = frozenset(
82-
{"ctx", "context", "_ctx", "hook_context"}
83-
)
84-
8578

8679
@dataclass(frozen=True)
8780
class _ExpandedSqlTest:

0 commit comments

Comments
 (0)