Skip to content

Commit e6ca0ab

Browse files
committed
Chore: do not fail if sqlglot optimization rules raise an exception
1 parent e430f50 commit e6ca0ab

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

sqlmesh/core/renderer.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -639,14 +639,12 @@ def _optimize_query(self, query: exp.Query, all_deps: t.Set[str]) -> exp.Query:
639639
)
640640
except SqlglotError as ex:
641641
self._violated_rules[AmbiguousOrInvalidColumn] = ex
642-
643642
query = original
644-
645643
except Exception as ex:
646-
raise_config_error(
647-
f"Failed to optimize query, please file an issue at https://github.com/TobikoData/sqlmesh/issues/new. {ex}",
648-
self._path,
644+
logger.warning(
645+
f"Failed to optimize query, please file an issue at https://github.com/TobikoData/sqlmesh/issues/new. {ex} at '{self._path}'",
649646
)
647+
query = original
650648

651649
if not query.type:
652650
for select in query.expressions:

0 commit comments

Comments
 (0)