Skip to content

Commit 9f253c3

Browse files
author
vishnu
committed
removed created schema for external catalogs, since athena gives error for this
1 parent ea72563 commit 9f253c3

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

sqlmesh/core/engine_adapter/athena.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,14 @@ def _create_schema(
166166
properties: t.List[exp.Expr],
167167
kind: str,
168168
) -> None:
169+
schema = to_schema(schema_name)
170+
if schema.catalog and schema.catalog != self._default_catalog:
171+
logger.info(
172+
"Skipping creation of schema '%s' because Athena does not support creating schemas in non-default catalogs.",
173+
schema.sql(dialect=self.dialect),
174+
)
175+
return
176+
169177
if location := self._table_location(table_properties=None, table=exp.to_table(schema_name)):
170178
# don't add extra LocationProperty's if one already exists
171179
if not any(p for p in properties if isinstance(p, exp.LocationProperty)):
@@ -687,7 +695,7 @@ def _boto3_client(self, name: str) -> t.Any:
687695
conn = self.connection
688696
return conn.session.client(
689697
name,
690-
region_name=conn.region_̀name,
698+
region_name=conn.region_name,
691699
config=conn.config,
692700
**conn._client_kwargs,
693701
) # type: ignore

0 commit comments

Comments
 (0)