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

pierrejeambrun pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v3-1-test by this push:
     new 37a5cb65382 [v3-1-test] fix: add __call__ to MockOptional for WTForms 
validator compatibility (#63823) (#64059)
37a5cb65382 is described below

commit 37a5cb65382e743012f922f3fea79c72e0def76e
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Mar 23 11:22:50 2026 +0100

    [v3-1-test] fix: add __call__ to MockOptional for WTForms validator 
compatibility (#63823) (#64059)
    
    (cherry picked from commit d603e6cf6882895c74fb403150eec18ef7575d85)
    
    
    Closes: #63803
    
    Co-authored-by: Yoann <[email protected]>
---
 .../core_api/services/ui/connections.py            |  3 ++
 .../core_api/services/ui/test_connections.py       | 32 ++++++++++++++++++++++
 2 files changed, 35 insertions(+)

diff --git 
a/airflow-core/src/airflow/api_fastapi/core_api/services/ui/connections.py 
b/airflow-core/src/airflow/api_fastapi/core_api/services/ui/connections.py
index ef045813e87..1f2d8f659d3 100644
--- a/airflow-core/src/airflow/api_fastapi/core_api/services/ui/connections.py
+++ b/airflow-core/src/airflow/api_fastapi/core_api/services/ui/connections.py
@@ -48,6 +48,9 @@ class HookMetaService:
         ):
             pass
 
+        def __call__(self, form, field):
+            pass
+
     class MockEnum:
         """Mock for wtforms.validators.Optional."""
 
diff --git 
a/airflow-core/tests/unit/api_fastapi/core_api/services/ui/test_connections.py 
b/airflow-core/tests/unit/api_fastapi/core_api/services/ui/test_connections.py
new file mode 100644
index 00000000000..e6ed84778d3
--- /dev/null
+++ 
b/airflow-core/tests/unit/api_fastapi/core_api/services/ui/test_connections.py
@@ -0,0 +1,32 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+from airflow.api_fastapi.core_api.services.ui.connections import 
HookMetaService
+
+
+class TestMockOptional:
+    def test_mock_optional_is_callable(self):
+        """MockOptional instances must be callable to satisfy WTForms 
validator checks."""
+        validator = HookMetaService.MockOptional()
+        assert callable(validator)
+
+    def test_mock_optional_call_is_noop(self):
+        """Calling MockOptional should be a no-op (returns None)."""
+        validator = HookMetaService.MockOptional()
+        result = validator(None, None)
+        assert result is None

Reply via email to