|
27 | 27 | ) |
28 | 28 | from sqlmesh.core.model.kind import SCDType2ByTimeKind, OnDestructiveChange, OnAdditiveChange |
29 | 29 | from sqlmesh.dbt.basemodel import BaseModelConfig, Materialization, SnapshotStrategy |
30 | | -from sqlmesh.dbt.common import SqlStr, extract_jinja_config, sql_str_validator |
| 30 | +from sqlmesh.dbt.common import SqlStr, sql_str_validator |
31 | 31 | from sqlmesh.utils.errors import ConfigError |
32 | 32 | from sqlmesh.utils.pydantic import field_validator |
33 | 33 |
|
@@ -138,10 +138,6 @@ class ModelConfig(BaseModelConfig): |
138 | 138 | inserts_only: t.Optional[bool] = None |
139 | 139 | incremental_predicates: t.Optional[t.List[str]] = None |
140 | 140 |
|
141 | | - # Private fields |
142 | | - _sql_embedded_config: t.Optional[SqlStr] = None |
143 | | - _sql_no_config: t.Optional[SqlStr] = None |
144 | | - |
145 | 141 | _sql_validator = sql_str_validator |
146 | 142 |
|
147 | 143 | @field_validator( |
@@ -432,25 +428,6 @@ def model_kind(self, context: DbtContext) -> ModelKind: |
432 | 428 |
|
433 | 429 | raise ConfigError(f"{materialization.value} materialization not supported.") |
434 | 430 |
|
435 | | - @property |
436 | | - def sql_no_config(self) -> SqlStr: |
437 | | - if self._sql_no_config is None: |
438 | | - self._sql_no_config = SqlStr("") |
439 | | - self._extract_sql_config() |
440 | | - return self._sql_no_config |
441 | | - |
442 | | - @property |
443 | | - def sql_embedded_config(self) -> SqlStr: |
444 | | - if self._sql_embedded_config is None: |
445 | | - self._sql_embedded_config = SqlStr("") |
446 | | - self._extract_sql_config() |
447 | | - return self._sql_embedded_config |
448 | | - |
449 | | - def _extract_sql_config(self) -> None: |
450 | | - no_config, embedded_config = extract_jinja_config(self.sql) |
451 | | - self._sql_no_config = SqlStr(no_config) |
452 | | - self._sql_embedded_config = SqlStr(embedded_config) |
453 | | - |
454 | 431 | def _big_query_partition_by_expr(self, context: DbtContext) -> exp.Expression: |
455 | 432 | assert isinstance(self.partition_by, dict) |
456 | 433 | data_type = self.partition_by["data_type"].lower() |
@@ -508,7 +485,7 @@ def to_sqlmesh( |
508 | 485 | ) -> Model: |
509 | 486 | """Converts the dbt model into a SQLMesh model.""" |
510 | 487 | model_dialect = self.dialect(context) |
511 | | - query = d.jinja_query(self.sql_no_config) |
| 488 | + query = d.jinja_query(self.sql) |
512 | 489 | kind = self.model_kind(context) |
513 | 490 |
|
514 | 491 | optional_kwargs: t.Dict[str, t.Any] = {} |
|
0 commit comments