Skip to content

Commit b44ce65

Browse files
authored
Chore!: bump sqlglot to v23.6.3 (#2382)
* Chore!: bump sqlglot to v23.4.0 * Bump to 23.6.3
1 parent 14ba624 commit b44ce65

File tree

5 files changed

+7
-19
lines changed

5 files changed

+7
-19
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"requests",
4747
"rich[jupyter]",
4848
"ruamel.yaml",
49-
"sqlglot[rs]~=23.3.0",
49+
"sqlglot[rs]~=23.6.3",
5050
],
5151
extras_require={
5252
"bigquery": [

sqlmesh/core/engine_adapter/base.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ class EngineAdapter:
8787
COMMENT_CREATION_VIEW = CommentCreationView.IN_SCHEMA_DEF_AND_COMMANDS
8888
MAX_TABLE_COMMENT_LENGTH: t.Optional[int] = None
8989
MAX_COLUMN_COMMENT_LENGTH: t.Optional[int] = None
90-
ESCAPE_COMMENT_BACKSLASH = True
9190
INSERT_OVERWRITE_STRATEGY = InsertOverwriteStrategy.DELETE_INSERT
9291
SUPPORTS_MATERIALIZED_VIEWS = False
9392
SUPPORTS_MATERIALIZED_VIEW_SCHEMA = False
@@ -1920,22 +1919,14 @@ def _build_view_properties_exp(
19201919
return exp.Properties(expressions=properties)
19211920
return None
19221921

1923-
def _truncate_comment(
1924-
self, comment: str, length: t.Optional[int], escape_backslash: bool = False
1925-
) -> str:
1926-
if escape_backslash:
1927-
comment = comment.replace("\\", "\\\\")
1922+
def _truncate_comment(self, comment: str, length: t.Optional[int]) -> str:
19281923
return comment[:length] if length else comment
19291924

19301925
def _truncate_table_comment(self, comment: str) -> str:
1931-
return self._truncate_comment(
1932-
comment, self.MAX_TABLE_COMMENT_LENGTH, self.ESCAPE_COMMENT_BACKSLASH
1933-
)
1926+
return self._truncate_comment(comment, self.MAX_TABLE_COMMENT_LENGTH)
19341927

19351928
def _truncate_column_comment(self, comment: str) -> str:
1936-
return self._truncate_comment(
1937-
comment, self.MAX_COLUMN_COMMENT_LENGTH, self.ESCAPE_COMMENT_BACKSLASH
1938-
)
1929+
return self._truncate_comment(comment, self.MAX_COLUMN_COMMENT_LENGTH)
19391930

19401931
def _to_sql(self, expression: exp.Expression, quote: bool = True, **kwargs: t.Any) -> str:
19411932
"""

sqlmesh/core/engine_adapter/bigquery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ def _create_column_comments(
445445
comment = column_comments.get(table_def["schema"]["fields"][i]["name"], None)
446446
if comment:
447447
table_def["schema"]["fields"][i]["description"] = self._truncate_comment(
448-
comment, self.MAX_COLUMN_COMMENT_LENGTH, escape_backslash=False
448+
comment, self.MAX_COLUMN_COMMENT_LENGTH
449449
)
450450

451451
# An "etag" is BQ versioning metadata that changes when an object is updated/modified. `update_table`

sqlmesh/core/engine_adapter/mixins.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,11 @@ def _build_view_properties_exp(
221221
return exp.Properties(expressions=properties)
222222
return None
223223

224-
def _truncate_comment(
225-
self, comment: str, length: t.Optional[int], escape_backslash: bool = False
226-
) -> str:
224+
def _truncate_comment(self, comment: str, length: t.Optional[int]) -> str:
227225
# iceberg and delta do not have a comment length limit
228226
if self.current_catalog_type in ("iceberg", "delta"):
229227
return comment
230-
return super()._truncate_comment(comment, length, escape_backslash)
228+
return super()._truncate_comment(comment, length)
231229

232230

233231
class GetCurrentCatalogFromFunctionMixin(EngineAdapter):

sqlmesh/core/engine_adapter/postgres.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class PostgresEngineAdapter(
2929
HAS_VIEW_BINDING = True
3030
CURRENT_CATALOG_EXPRESSION = exp.column("current_catalog")
3131
SUPPORTS_REPLACE_TABLE = False
32-
ESCAPE_COMMENT_BACKSLASH = False
3332

3433
def _fetch_native_df(
3534
self, query: t.Union[exp.Expression, str], quote_identifiers: bool = False

0 commit comments

Comments
 (0)