uranusjr commented on code in PR #55110:
URL: https://github.com/apache/airflow/pull/55110#discussion_r2430918660


##########
providers/apache/hive/src/airflow/providers/apache/hive/operators/hive.py:
##########
@@ -143,9 +143,15 @@ def execute(self, context: Context) -> None:
         # set the mapred_job_name if it's not set with dag, task, execution 
time info
         if not self.mapred_job_name:
             ti = context["ti"]
-            logical_date = context["logical_date"]
+            logical_date = context.get("logical_date", None)
             if logical_date is None:
-                raise RuntimeError("logical_date is None")
+                raise RuntimeError(
+                    "logical_date is None. Please make sure the task is not 
used in an asset-triggered Dag. "
+                    "HiveOperator was designed to work with timetable 
scheduled Dags, "
+                    "and asset-triggered Dags do not have logical_date. "
+                    "If asset-triggered HiveOperator is a required use case, "
+                    "please open an issue on the Airflow project."

Review Comment:
   ```suggestion
                       "logical_date is not available. Please make sure the 
task is not used in an asset-triggered dag. "
                       "HiveOperator was designed to work with timetable 
scheduled dags, "
                       "and an asset-triggered dag run does not have a 
logical_date. "
                       "If you need to use HiveOperator with an asset-triggered 
dag,"
                       "please open an issue on the Airflow project."
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to