|
25 | 25 | from sqlmesh.dbt.util import DBT_VERSION |
26 | 26 | from sqlmesh.utils import AttributeDict, debug_mode_enabled, yaml |
27 | 27 | from sqlmesh.utils.date import now |
28 | | -from sqlmesh.utils.errors import ConfigError, MacroEvalError |
| 28 | +from sqlmesh.utils.errors import ConfigError |
29 | 29 | from sqlmesh.utils.jinja import JinjaMacroRegistry, MacroReference, MacroReturnVal |
30 | 30 |
|
31 | 31 | logger = logging.getLogger(__name__) |
@@ -381,18 +381,16 @@ def do_zip(*args: t.Any, default: t.Optional[t.Any] = None) -> t.Optional[t.Any] |
381 | 381 | return default |
382 | 382 |
|
383 | 383 |
|
384 | | -def as_bool(value: str) -> bool: |
385 | | - result = _try_literal_eval(value) |
386 | | - if isinstance(result, bool): |
387 | | - return result |
388 | | - raise MacroEvalError(f"Failed to convert '{value}' into boolean.") |
| 384 | +def as_bool(value: t.Any) -> t.Any: |
| 385 | + # dbt's jinja TEXT_FILTERS just return the input value as is |
| 386 | + # https://github.com/dbt-labs/dbt-common/blob/main/dbt_common/clients/jinja.py#L559 |
| 387 | + return value |
389 | 388 |
|
390 | 389 |
|
391 | 390 | def as_number(value: str) -> t.Any: |
392 | | - result = _try_literal_eval(value) |
393 | | - if isinstance(value, (int, float)) and not isinstance(result, bool): |
394 | | - return result |
395 | | - raise MacroEvalError(f"Failed to convert '{value}' into number.") |
| 391 | + # dbt's jinja TEXT_FILTERS just return the input value as is |
| 392 | + # https://github.com/dbt-labs/dbt-common/blob/main/dbt_common/clients/jinja.py#L559 |
| 393 | + return value |
396 | 394 |
|
397 | 395 |
|
398 | 396 | def _try_literal_eval(value: str) -> t.Any: |
|
0 commit comments