Skip to content

Commit

Permalink
when there is macros in the sql, make sure it can be replaced with va…
Browse files Browse the repository at this point in the history
…lue (#4)
  • Loading branch information
zongsizhang authored May 28, 2024
1 parent 02cf257 commit d512652
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 86 deletions.
6 changes: 6 additions & 0 deletions airflow_providers_wherobots/operators/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

from __future__ import annotations

from typing import Sequence

from airflow.providers.common.sql.hooks.sql import DbApiHook
from airflow.providers.common.sql.operators.sql import SQLExecuteQueryOperator
from wherobots.db import Runtime
Expand All @@ -30,6 +32,10 @@ def wherobots_default_handler(cursor: WDbCursor) -> DataFrame | None:

class WherobotsSqlOperator(SQLExecuteQueryOperator): # type: ignore[misc]

template_fields: Sequence[str] = SQLExecuteQueryOperator.template_fields
template_fields_renderers = {"sql": "sql"}
conn_id_field = "wherobots_conn_id"

def __init__( # type: ignore[no-untyped-def]
self,
*,
Expand Down
Loading

0 comments on commit d512652

Please sign in to comment.