diff --git a/airflow/providers/apache/hive/operators/hive_stats.py b/airflow/providers/apache/hive/operators/hive_stats.py index d816541ffa62f..327e8a676fc5b 100644 --- a/airflow/providers/apache/hive/operators/hive_stats.py +++ b/airflow/providers/apache/hive/operators/hive_stats.py @@ -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: @@ -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."""