MannXo commented on code in PR #70326:
URL: https://github.com/apache/airflow/pull/70326#discussion_r3646082116


##########
providers/weaviate/src/airflow/providers/weaviate/operators/weaviate.py:
##########
@@ -75,15 +75,16 @@ def __init__(
         self.input_data = input_data
         self.hook_params = hook_params or {}
 
-        if self.input_data is None:
-            raise TypeError("input_data is required")
-
     @cached_property
     def hook(self) -> WeaviateHook:
         """Return an instance of the WeaviateHook."""
         return WeaviateHook(conn_id=self.conn_id, **self.hook_params)
 
     def execute(self, context: Context) -> None:
+        # input_data is a template field; validate it after rendering rather 
than in __init__,
+        # where the check would run against the un-rendered value.
+        if self.input_data is None:
+            raise TypeError("input_data is required")

Review Comment:
   Reflected. Dropped the `= None `default on `input_data` -> now `input_data: 
list[dict[str, Any]] | pd.DataFrame` (required). Python raises `TypeError` at 
parse time if it's omitted; the `execute()` check stays to catch values that 
render to `None`.
   



-- 
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