Skip to content

Commit 591bbfb

Browse files
committed
inline current_schema() expression in base_postgres._get_current_schema()
1 parent db48d2c commit 591bbfb

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

sqlmesh/core/engine_adapter/base_postgres.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class BasePostgresEngineAdapter(EngineAdapter):
2626
COMMENT_CREATION_VIEW = CommentCreationView.COMMENT_COMMAND_ONLY
2727
SUPPORTS_QUERY_EXECUTION_TRACKING = True
2828
SUPPORTED_DROP_CASCADE_OBJECT_KINDS = ["SCHEMA", "TABLE", "VIEW"]
29-
CURRENT_SCHEMA_EXPRESSION = exp.func("current_schema")
3029

3130
def columns(
3231
self, table_name: TableName, include_pseudo_columns: bool = False
@@ -193,7 +192,7 @@ def _get_data_objects(
193192

194193
def _get_current_schema(self) -> str:
195194
"""Returns the current default schema for the connection."""
196-
result = self.fetchone(exp.select(self.CURRENT_SCHEMA_EXPRESSION))
195+
result = self.fetchone(exp.select(exp.func("current_schema")))
197196
if result and result[0]:
198197
return result[0]
199198
return "public"

0 commit comments

Comments
 (0)