Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions fakesnow/cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,17 @@ def _execute(self, transformed: Expr, params: MutableParams | None = None) -> No
if not sql:
raise NotImplementedError(transformed.sql(dialect="snowflake"))

if (
cmd == "CREATE"
and isinstance(transformed, exp.Command)
and re.search(r"\bMACRO\b", transformed.expression, re.IGNORECASE)
):
raise snowflake.connector.errors.ProgrammingError(
msg="SQL compilation error:\nUnsupported feature 'CREATE MACRO'.",
errno=2,
sqlstate="0A000",
)

if sfqid := transformed.args.get("result_scan_sfqid"):
value = self._conn.results_cache.get(sfqid)
if value is None:
Expand Down