kosiew commented on code in PR #68017:
URL: https://github.com/apache/airflow/pull/68017#discussion_r3519282137


##########
providers/databricks/docs/operators/run_now.rst:
##########
@@ -80,3 +80,41 @@ DatabricksRunNowDeferrableOperator
 Deferrable version of the 
:class:`~airflow.providers.databricks.operators.DatabricksRunNowOperator` 
operator.
 
 It allows to utilize Airflow workers more effectively using `new functionality 
introduced in Airflow 2.2.0 
<https://airflow.apache.org/docs/apache-airflow/2.2.0/concepts/deferring.html#triggering-deferral>`_
+
+.. _howto/operator:DatabricksRunNowDeferrableOperator:retry-args:
+
+Retry args in deferrable mode
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+When ``deferrable=True``, the ``databricks_retry_args`` dictionary is 
serialized across the
+trigger boundary and must contain only Airflow-serializable values (plain 
Python primitives
+such as ``int``, ``float``, ``str``, ``bool``, ``None``, ``dict``, and 
``list``).
+
+**Supported** (serialization-safe and runtime-valid):
+
+.. code-block:: python
+
+    # Only plain-primitive Retrying kwarg: reraise
+    databricks_retry_args = {"reraise": True}
+
+For controlling attempt count and delay, prefer the dedicated operator
+parameters ``retry_limit`` and ``retry_delay`` rather than
+``databricks_retry_args``. Custom tenacity strategy objects (``stop``,
+``wait``, ``retry``, ``before``, ``after``, etc.) require tenacity
+callable objects, which are not serialization-safe in deferrable mode.
+
+**Not supported** in deferrable mode (will raise ``ValueError`` at task 
submission):
+
+.. code-block:: python
+
+    from tenacity import stop_after_attempt, wait_incrementing
+
+    # Tenacity strategy objects — NOT serializable
+    databricks_retry_args = {"stop": stop_after_attempt(3)}
+    databricks_retry_args = {"wait": wait_incrementing(start=30, increment=30)}
+
+    # Arbitrary callables — NOT serializable
+    databricks_retry_args = {"retry": my_custom_retry_callable}
+
+If you need a custom callable retry strategy, use the non-deferrable
+:class:`~airflow.providers.databricks.operators.DatabricksRunNowOperator` 
(``deferrable=False``).

Review Comment:
   Implemented in `run_now.rst`; also mirrored in `submit_run.rst`. |



##########
providers/databricks/docs/operators/run_now.rst:
##########
@@ -80,3 +80,41 @@ DatabricksRunNowDeferrableOperator
 Deferrable version of the 
:class:`~airflow.providers.databricks.operators.DatabricksRunNowOperator` 
operator.
 
 It allows to utilize Airflow workers more effectively using `new functionality 
introduced in Airflow 2.2.0 
<https://airflow.apache.org/docs/apache-airflow/2.2.0/concepts/deferring.html#triggering-deferral>`_
+
+.. _howto/operator:DatabricksRunNowDeferrableOperator:retry-args:
+
+Retry args in deferrable mode
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+When ``deferrable=True``, the ``databricks_retry_args`` dictionary is 
serialized across the
+trigger boundary and must contain only Airflow-serializable values (plain 
Python primitives
+such as ``int``, ``float``, ``str``, ``bool``, ``None``, ``dict``, and 
``list``).
+
+**Supported** (serialization-safe and runtime-valid):
+
+.. code-block:: python
+
+    # Only plain-primitive Retrying kwarg: reraise
+    databricks_retry_args = {"reraise": True}
+
+For controlling attempt count and delay, prefer the dedicated operator
+parameters ``retry_limit`` and ``retry_delay`` rather than
+``databricks_retry_args``. Custom tenacity strategy objects (``stop``,
+``wait``, ``retry``, ``before``, ``after``, etc.) require tenacity
+callable objects, which are not serialization-safe in deferrable mode.
+
+**Not supported** in deferrable mode (will raise ``ValueError`` at task 
submission):
+
+.. code-block:: python
+
+    from tenacity import stop_after_attempt, wait_incrementing
+
+    # Tenacity strategy objects — NOT serializable
+    databricks_retry_args = {"stop": stop_after_attempt(3)}
+    databricks_retry_args = {"wait": wait_incrementing(start=30, increment=30)}
+
+    # Arbitrary callables — NOT serializable
+    databricks_retry_args = {"retry": my_custom_retry_callable}
+
+If you need a custom callable retry strategy, use the non-deferrable
+:class:`~airflow.providers.databricks.operators.DatabricksRunNowOperator` 
(``deferrable=False``).

Review Comment:
   Implemented in `run_now.rst`; also mirrored in `submit_run.rst`. 



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