Skip to content

Commit

Permalink
Fix assignment of template field in __init__ in hive-stats (#36905)
Browse files Browse the repository at this point in the history
* add templated fields to constructor

* Fix from execution_date to logical_date

Co-authored-by: Andrey Anshin <Andrey.Anshin@taragol.is>

---------

Co-authored-by: Andrey Anshin <Andrey.Anshin@taragol.is>
  • Loading branch information
romsharon98 and Taragolis committed Jan 19, 2024
1 parent 66de4bd commit 1119b06
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions airflow/providers/apache/hive/operators/hive_stats.py
Expand Up @@ -76,6 +76,8 @@ def __init__(
metastore_conn_id: str = "metastore_default",
presto_conn_id: str = "presto_default",
mysql_conn_id: str = "airflow_db",
ds: str = "{{ ds }}",
dttm: str = "{{ logical_date.isoformat() }}",
**kwargs: Any,
) -> None:
if "col_blacklist" in kwargs:
Expand All @@ -96,8 +98,8 @@ def __init__(
self.presto_conn_id = presto_conn_id
self.mysql_conn_id = mysql_conn_id
self.assignment_func = assignment_func
self.ds = "{{ ds }}"
self.dttm = "{{ execution_date.isoformat() }}"
self.ds = ds
self.dttm = dttm

def get_default_exprs(self, col: str, col_type: str) -> dict[Any, Any]:
"""Get default expressions."""
Expand Down

0 comments on commit 1119b06

Please sign in to comment.