dabla commented on code in PR #77153:
URL: https://github.com/apache/airflow/pull/77153#discussion_r4583611219


##########
providers/amazon/tests/unit/amazon/aws/transfers/test_sql_to_s3.py:
##########
@@ -688,6 +694,32 @@ def 
test_render_template_fields_rejects_a_negative_page_size(self):
         with pytest.raises(ValueError, match="page_size can not be negative"):
             op.render_template_fields({})
 
+    @pytest.mark.skipif(not AIRFLOW_V_3_0_PLUS, reason="create_runtime_ti 
needs the Task SDK")
+    @pytest.mark.parametrize(
+        ("page_size", "expected"),
+        [
+            pytest.param("{{ 1 + 1 }}", 2, id="templated"),
+            pytest.param("0", 0, id="rendered-zero-means-unpaged"),

Review Comment:
   **[warning]** Please add a mapped test for the negative `page_size` check, 
the third symptom in #77151.
   
   The issue says the negative-value check is skipped for mapped tasks. The fix 
restores it (I checked: `page_size="-1"` on a `.partial().expand()` task now 
raises `ValueError: ... can not be negative` from `ti.render_templates()`), but 
only the plain-task test 
`test_render_template_fields_rejects_a_negative_page_size` covers it, and that 
one passed before this change too. Every behaviour the PR fixes needs a test 
that fails without it:
   
   ```python
   def test_render_templates_rejects_a_negative_page_size_for_mapped_task(self, 
create_runtime_ti):
       ...
       with pytest.raises(ValueError, match="page_size can not be negative"):
           ti.render_templates(context=ti.get_template_context())
   ```



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