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

Miretpl 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 a139b9d8c66 Add missing unit tests for the apache.hive macros plugin 
(#72447)
a139b9d8c66 is described below

commit a139b9d8c6641ce941bac42e02a729b4eb82920a
Author: Wade Twyford <[email protected]>
AuthorDate: Mon Nov 9 21:53:36 2026 +0000

    Add missing unit tests for the apache.hive macros plugin (#72447)
    
    * Remove dead type-mismatched guard in airflow-ctl command generation 
(#70945)
    
    The condition compared a Pydantic model class against a dict keyed by
    model name, so it never held. It happened to be load-bearing: it forced
    the field list to be rebuilt on every visit, which is what kept
    datamodels shared by several operations (ConnectionBody, VariableBody,
    BackfillPostBody) from accumulating duplicate entries. Correcting the
    comparison to match the key type would have silently introduced those
    duplicates, so the guard is dropped in favour of the unconditional reset
    it was already performing.
    
    * Update providers/apache/hive/tests/unit/apache/hive/plugins/test_hive.py
    
    Co-authored-by: Ryan Hatter <[email protected]>
    
    * [fix/testing] updating util import to not use ._shared, avoiding 
backwards compat problem
    
    ---------
    
    Co-authored-by: rjgoyln <[email protected]>
    Co-authored-by: Ryan Hatter <[email protected]>
    Co-authored-by: Wade Twyford <[email protected]>
    Co-authored-by: Przemysław Mirowski 
<[email protected]>
---
 .../tests/unit/apache/hive/plugins/test_hive.py     | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/providers/apache/hive/tests/unit/apache/hive/plugins/test_hive.py 
b/providers/apache/hive/tests/unit/apache/hive/plugins/test_hive.py
index 726b9113f02..97624077180 100644
--- a/providers/apache/hive/tests/unit/apache/hive/plugins/test_hive.py
+++ b/providers/apache/hive/tests/unit/apache/hive/plugins/test_hive.py
@@ -18,10 +18,23 @@ from __future__ import annotations
 
 from airflow.providers.apache.hive.macros.hive import closest_ds_partition, 
max_partition
 from airflow.providers.apache.hive.plugins.hive import HivePlugin
+from airflow.providers.common.compat.module_loading import import_string
+from airflow.providers.common.compat.sdk import AirflowPlugin
 
 
-def test_hive_plugin_registers_macros():
-    plugin = HivePlugin()
+class TestHivePlugin:
+    def test_name_is_hive(self):
+        assert HivePlugin.name == "hive"
 
-    assert plugin.name == "hive"
-    assert plugin.macros == [max_partition, closest_ds_partition]
+    def test_exposed_macros(self):
+        assert max_partition in HivePlugin.macros
+        assert closest_ds_partition in HivePlugin.macros
+
+    def test_subclasses_airflow_plugin(self):
+        assert issubclass(HivePlugin, AirflowPlugin)
+
+    def test_hive_plugin_dotted_path(self):
+        path = "airflow.providers.apache.hive.plugins.hive.HivePlugin"
+        resolved_class = import_string(path)
+
+        assert resolved_class is HivePlugin

Reply via email to