Sagargupta16 commented on code in PR #63109:
URL: https://github.com/apache/airflow/pull/63109#discussion_r2912139711


##########
providers/salesforce/tests/unit/salesforce/operators/test_bulk.py:
##########
@@ -40,13 +77,14 @@ def test_execute_missing_operation(self):
                 payload=[],
             )
 
+        operator = SalesforceBulkOperator(
+            task_id="missing_operation",
+            operation="operation",
+            object_name="Account",
+            payload=[],
+        )
         with pytest.raises(ValueError, match="Operation 'operation' not 
found!"):
-            SalesforceBulkOperator(
-                task_id="missing_operation",
-                operation="operation",
-                object_name="Account",
-                payload=[],
-            )
+            operator.execute(context={})

Review Comment:
   Moved `_validate_inputs()` from `__init__` to `execute()` because 
template_fields need to render before validation runs.
   
   Without this, passing a Jinja template like `operation="{{ params.op }}"` 
would fail validation during `__init__` since the raw template string isn't a 
valid operation. Validation needs to happen at execution time after 
`render_templates()` resolves the values.
   
   The test was updated to match: create the operator first (no validation 
error), then call `execute()` which triggers validation on the resolved values.



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