This is an automated email from the ASF dual-hosted git repository.

shahar1 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 4dff3767564 Include endpoint_prefix in LivyTrigger serialization 
(#66966)
4dff3767564 is described below

commit 4dff37675647cfb02912e9241c65b7d8981cf4c9
Author: Nishita Matlani <[email protected]>
AuthorDate: Sun May 17 15:57:38 2026 -0400

    Include endpoint_prefix in LivyTrigger serialization (#66966)
---
 .../livy/src/airflow/providers/apache/livy/triggers/livy.py |  2 ++
 .../livy/tests/unit/apache/livy/triggers/test_livy.py       | 13 +++++++++++++
 2 files changed, 15 insertions(+)

diff --git 
a/providers/apache/livy/src/airflow/providers/apache/livy/triggers/livy.py 
b/providers/apache/livy/src/airflow/providers/apache/livy/triggers/livy.py
index 20a8e0382d7..2d0cb99a642 100644
--- a/providers/apache/livy/src/airflow/providers/apache/livy/triggers/livy.py
+++ b/providers/apache/livy/src/airflow/providers/apache/livy/triggers/livy.py
@@ -42,6 +42,7 @@ class LivyTrigger(BaseTrigger):
         depends on the option that's being modified.
     :param extra_headers: A dictionary of headers passed to the HTTP request 
to livy.
     :param livy_hook_async: LivyAsyncHook object
+    :param endpoint_prefix: Optional URL prefix for the Livy API endpoint.
     """
 
     def __init__(
@@ -80,6 +81,7 @@ class LivyTrigger(BaseTrigger):
                 "extra_headers": self._extra_headers,
                 "livy_hook_async": self._livy_hook_async,
                 "execution_timeout": self._execution_timeout,
+                "endpoint_prefix": self._endpoint_prefix,
             },
         )
 
diff --git a/providers/apache/livy/tests/unit/apache/livy/triggers/test_livy.py 
b/providers/apache/livy/tests/unit/apache/livy/triggers/test_livy.py
index df85a84bac3..1fc92a2c7b1 100644
--- a/providers/apache/livy/tests/unit/apache/livy/triggers/test_livy.py
+++ b/providers/apache/livy/tests/unit/apache/livy/triggers/test_livy.py
@@ -48,8 +48,21 @@ class TestLivyTrigger:
             "extra_headers": None,
             "livy_hook_async": None,
             "execution_timeout": None,
+            "endpoint_prefix": None,
         }
 
+    def test_livy_trigger_serialize_round_trip_endpoint_prefix(self):
+        trigger = LivyTrigger(
+            batch_id=1,
+            spark_params={},
+            livy_conn_id=LivyHook.default_conn_name,
+            polling_interval=0,
+            endpoint_prefix="/custom",
+        )
+        _, kwargs = trigger.serialize()
+        restored = LivyTrigger(**kwargs)
+        assert restored._endpoint_prefix == "/custom"
+
     @pytest.mark.asyncio
     
@mock.patch("airflow.providers.apache.livy.triggers.livy.LivyTrigger.poll_for_termination")
     async def test_livy_trigger_run_with_no_poll_interval(self, 
mock_poll_for_termination):

Reply via email to