ashb commented on code in PR #74773:
URL: https://github.com/apache/airflow/pull/74773#discussion_r4315450394
##########
airflow-core/docs/authoring-and-scheduling/loops.rst:
##########
@@ -82,7 +82,9 @@ loop body must be keyword-only and cannot have a default
other than ``None``.
In a templated field, a Jinja ``{% for %}`` block defines its own ``loop``
that hides this one for
the length of the block. Read the Airflow value before the block and use that
inside it, for example
-``{% set iteration = loop.index %}``.
+``{% set iteration = loop.index %}``. Both count from one, so ``loop.index``
reads the same either
+way, but Jinja's loop also offers ``loop.index0`` and Airflow's does not:
outside a ``{% for %}``
+block ``loop.index0`` raises an ``AttributeError``, and inside one it is
Jinja's own counter.
Review Comment:
Yes this is true, but I don't think we should confuse people with Jinja's
loop behaviour, other than just "it might collide".
--
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]