apache-airflow-providers-apache-hive 9.1.3rc1__py3-none-any.whl → 9.2.3rc1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,11 +29,11 @@ from airflow import __version__ as airflow_version
29
29
 
30
30
  __all__ = ["__version__"]
31
31
 
32
- __version__ = "9.1.3"
32
+ __version__ = "9.2.3"
33
33
 
34
34
  if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
35
- "2.10.0"
35
+ "2.11.0"
36
36
  ):
37
37
  raise RuntimeError(
38
- f"The package `apache-airflow-providers-apache-hive:{__version__}` needs Apache Airflow 2.10.0+"
38
+ f"The package `apache-airflow-providers-apache-hive:{__version__}` needs Apache Airflow 2.11.0+"
39
39
  )
@@ -29,13 +29,15 @@ from tempfile import NamedTemporaryFile, TemporaryDirectory
29
29
  from typing import TYPE_CHECKING, Any, Literal
30
30
 
31
31
  from deprecated import deprecated
32
+ from sqlalchemy.engine import URL
32
33
  from typing_extensions import overload
33
34
 
34
- from airflow.configuration import conf
35
- from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
35
+ from airflow.exceptions import AirflowProviderDeprecationWarning
36
36
  from airflow.providers.common.compat.sdk import (
37
37
  AIRFLOW_VAR_NAME_FORMAT_MAPPING,
38
+ AirflowException,
38
39
  BaseHook,
40
+ conf,
39
41
  )
40
42
  from airflow.providers.common.sql.hooks.sql import DbApiHook
41
43
  from airflow.security import utils
@@ -320,8 +322,8 @@ class HiveCliHook(BaseHook):
320
322
  )
321
323
  self.sub_process = sub_process
322
324
  stdout = ""
323
- for line in iter(sub_process.stdout.readline, b""):
324
- line = line.decode()
325
+ for line_raw in iter(sub_process.stdout.readline, b""):
326
+ line = line_raw.decode()
325
327
  stdout += line
326
328
  if verbose:
327
329
  self.log.info(line.strip())
@@ -336,24 +338,23 @@ class HiveCliHook(BaseHook):
336
338
  """Test an hql statement using the hive cli and EXPLAIN."""
337
339
  create, insert, other = [], [], []
338
340
  for query in hql.split(";"): # naive
339
- query_original = query
340
- query = query.lower().strip()
341
-
342
- if query.startswith("create table"):
343
- create.append(query_original)
344
- elif query.startswith(("set ", "add jar ", "create temporary function")):
345
- other.append(query_original)
346
- elif query.startswith("insert"):
347
- insert.append(query_original)
341
+ query_lower = query.lower().strip()
342
+
343
+ if query_lower.startswith("create table"):
344
+ create.append(query)
345
+ elif query_lower.startswith(("set ", "add jar ", "create temporary function")):
346
+ other.append(query)
347
+ elif query_lower.startswith("insert"):
348
+ insert.append(query)
348
349
  other_ = ";".join(other)
349
350
  for query_set in [create, insert]:
350
- for query in query_set:
351
- query_preview = " ".join(query.split())[:50]
351
+ for query_item in query_set:
352
+ query_preview = " ".join(query_item.split())[:50]
352
353
  self.log.info("Testing HQL [%s (...)]", query_preview)
353
354
  if query_set == insert:
354
- query = other_ + "; explain " + query
355
+ query = other_ + "; explain " + query_item
355
356
  else:
356
- query = "explain " + query
357
+ query = "explain " + query_item
357
358
  try:
358
359
  self.run_cli(query, verbose=False)
359
360
  except AirflowException as e:
@@ -1037,7 +1038,7 @@ class HiveServer2Hook(DbApiHook):
1037
1038
  try:
1038
1039
  import pandas as pd
1039
1040
  except ImportError as e:
1040
- from airflow.exceptions import AirflowOptionalProviderFeatureException
1041
+ from airflow.providers.common.compat.sdk import AirflowOptionalProviderFeatureException
1041
1042
 
1042
1043
  raise AirflowOptionalProviderFeatureException(e)
1043
1044
 
@@ -1056,7 +1057,7 @@ class HiveServer2Hook(DbApiHook):
1056
1057
  try:
1057
1058
  import polars as pl
1058
1059
  except ImportError as e:
1059
- from airflow.exceptions import AirflowOptionalProviderFeatureException
1060
+ from airflow.providers.common.compat.sdk import AirflowOptionalProviderFeatureException
1060
1061
 
1061
1062
  raise AirflowOptionalProviderFeatureException(e)
1062
1063
 
@@ -1131,3 +1132,25 @@ class HiveServer2Hook(DbApiHook):
1131
1132
  **kwargs,
1132
1133
  ) -> pd.DataFrame:
1133
1134
  return self._get_pandas_df(sql, schema=schema, hive_conf=hive_conf, **kwargs)
1135
+
1136
+ @property
1137
+ def sqlalchemy_url(self) -> URL:
1138
+ """Return a `sqlalchemy.engine.URL` object constructed from the connection."""
1139
+ conn = self.get_connection(self.get_conn_id())
1140
+ extra = conn.extra_dejson or {}
1141
+
1142
+ query = {k: str(v) for k, v in extra.items() if v is not None and k != "__extra__"}
1143
+
1144
+ return URL.create(
1145
+ drivername="hive",
1146
+ username=conn.login,
1147
+ password=conn.password,
1148
+ host=conn.host,
1149
+ port=conn.port,
1150
+ database=conn.schema,
1151
+ query=query,
1152
+ )
1153
+
1154
+ def get_uri(self) -> str:
1155
+ """Return a SQLAlchemy engine URL as a string."""
1156
+ return self.sqlalchemy_url.render_as_string(hide_password=False)
@@ -23,11 +23,11 @@ from collections.abc import Sequence
23
23
  from functools import cached_property
24
24
  from typing import TYPE_CHECKING, Any
25
25
 
26
- from airflow.configuration import conf
27
26
  from airflow.providers.apache.hive.hooks.hive import HiveCliHook
28
27
  from airflow.providers.common.compat.sdk import (
29
28
  AIRFLOW_VAR_NAME_FORMAT_MAPPING,
30
29
  BaseOperator,
30
+ conf,
31
31
  context_to_airflow_vars,
32
32
  )
33
33
 
@@ -21,9 +21,8 @@ import json
21
21
  from collections.abc import Callable, Sequence
22
22
  from typing import TYPE_CHECKING, Any
23
23
 
24
- from airflow.exceptions import AirflowException
25
24
  from airflow.providers.apache.hive.hooks.hive import HiveMetastoreHook
26
- from airflow.providers.common.compat.sdk import BaseOperator
25
+ from airflow.providers.common.compat.sdk import AirflowException, BaseOperator
27
26
  from airflow.providers.mysql.hooks.mysql import MySqlHook
28
27
  from airflow.providers.presto.hooks.presto import PrestoHook
29
28
 
@@ -17,8 +17,8 @@
17
17
 
18
18
  from __future__ import annotations
19
19
 
20
- from airflow.plugins_manager import AirflowPlugin
21
20
  from airflow.providers.apache.hive.macros.hive import closest_ds_partition, max_partition
21
+ from airflow.providers.common.compat.sdk import AirflowPlugin
22
22
 
23
23
 
24
24
  class HivePlugin(AirflowPlugin):
@@ -28,10 +28,9 @@ from collections.abc import Sequence
28
28
  from tempfile import NamedTemporaryFile, TemporaryDirectory
29
29
  from typing import TYPE_CHECKING, Any
30
30
 
31
- from airflow.exceptions import AirflowException
32
31
  from airflow.providers.amazon.aws.hooks.s3 import S3Hook
33
32
  from airflow.providers.apache.hive.hooks.hive import HiveCliHook
34
- from airflow.providers.common.compat.sdk import BaseOperator
33
+ from airflow.providers.common.compat.sdk import AirflowException, BaseOperator
35
34
 
36
35
  if TYPE_CHECKING:
37
36
  from airflow.providers.common.compat.sdk import Context
@@ -1,12 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apache-airflow-providers-apache-hive
3
- Version: 9.1.3rc1
3
+ Version: 9.2.3rc1
4
4
  Summary: Provider package apache-airflow-providers-apache-hive for Apache Airflow
5
5
  Keywords: airflow-provider,apache.hive,airflow,integration
6
6
  Author-email: Apache Software Foundation <dev@airflow.apache.org>
7
7
  Maintainer-email: Apache Software Foundation <dev@airflow.apache.org>
8
8
  Requires-Python: >=3.10
9
9
  Description-Content-Type: text/x-rst
10
+ License-Expression: Apache-2.0
10
11
  Classifier: Development Status :: 5 - Production/Stable
11
12
  Classifier: Environment :: Console
12
13
  Classifier: Environment :: Web Environment
@@ -14,37 +15,38 @@ Classifier: Intended Audience :: Developers
14
15
  Classifier: Intended Audience :: System Administrators
15
16
  Classifier: Framework :: Apache Airflow
16
17
  Classifier: Framework :: Apache Airflow :: Provider
17
- Classifier: License :: OSI Approved :: Apache Software License
18
18
  Classifier: Programming Language :: Python :: 3.10
19
19
  Classifier: Programming Language :: Python :: 3.11
20
20
  Classifier: Programming Language :: Python :: 3.12
21
21
  Classifier: Programming Language :: Python :: 3.13
22
22
  Classifier: Topic :: System :: Monitoring
23
- Requires-Dist: apache-airflow>=2.10.0rc1
24
- Requires-Dist: apache-airflow-providers-common-compat>=1.8.0rc1
23
+ License-File: LICENSE
24
+ License-File: NOTICE
25
+ Requires-Dist: apache-airflow>=2.11.0rc1
26
+ Requires-Dist: apache-airflow-providers-common-compat>=1.12.0rc1
25
27
  Requires-Dist: apache-airflow-providers-common-sql>=1.26.0rc1
26
28
  Requires-Dist: hmsclient>=0.1.0
27
29
  Requires-Dist: pandas>=2.1.2; python_version <"3.13"
28
30
  Requires-Dist: pandas>=2.2.3; python_version >="3.13"
29
31
  Requires-Dist: pyhive[hive-pure-sasl]>=0.7.0
30
- Requires-Dist: thrift>=0.11.0
31
32
  Requires-Dist: jmespath>=0.7.0
32
33
  Requires-Dist: apache-airflow-providers-amazon ; extra == "amazon"
33
- Requires-Dist: apache-airflow-providers-common-compat ; extra == "common-compat"
34
+ Requires-Dist: winkerberos>=0.7.0 ; extra == "gssapi" and ( sys_platform == "win32")
35
+ Requires-Dist: kerberos>=1.3.0 ; extra == "gssapi" and ( sys_platform != "win32")
34
36
  Requires-Dist: apache-airflow-providers-microsoft-mssql ; extra == "microsoft-mssql"
35
37
  Requires-Dist: apache-airflow-providers-mysql ; extra == "mysql"
36
38
  Requires-Dist: apache-airflow-providers-presto ; extra == "presto"
37
39
  Requires-Dist: apache-airflow-providers-samba ; extra == "samba"
38
40
  Requires-Dist: apache-airflow-providers-vertica ; extra == "vertica"
39
41
  Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
40
- Project-URL: Changelog, https://airflow.staged.apache.org/docs/apache-airflow-providers-apache-hive/9.1.3/changelog.html
41
- Project-URL: Documentation, https://airflow.staged.apache.org/docs/apache-airflow-providers-apache-hive/9.1.3
42
+ Project-URL: Changelog, https://airflow.staged.apache.org/docs/apache-airflow-providers-apache-hive/9.2.3/changelog.html
43
+ Project-URL: Documentation, https://airflow.staged.apache.org/docs/apache-airflow-providers-apache-hive/9.2.3
42
44
  Project-URL: Mastodon, https://fosstodon.org/@airflow
43
45
  Project-URL: Slack Chat, https://s.apache.org/airflow-slack
44
46
  Project-URL: Source Code, https://github.com/apache/airflow
45
47
  Project-URL: YouTube, https://www.youtube.com/channel/UCSXwxpWZQ7XZ1WL3wqevChA/
46
48
  Provides-Extra: amazon
47
- Provides-Extra: common-compat
49
+ Provides-Extra: gssapi
48
50
  Provides-Extra: microsoft-mssql
49
51
  Provides-Extra: mysql
50
52
  Provides-Extra: presto
@@ -76,7 +78,7 @@ Provides-Extra: vertica
76
78
 
77
79
  Package ``apache-airflow-providers-apache-hive``
78
80
 
79
- Release: ``9.1.3``
81
+ Release: ``9.2.3``
80
82
 
81
83
 
82
84
  `Apache Hive <https://hive.apache.org/>`__
@@ -89,7 +91,7 @@ This is a provider package for ``apache.hive`` provider. All classes for this pr
89
91
  are in ``airflow.providers.apache.hive`` python package.
90
92
 
91
93
  You can find package information and changelog for the provider
92
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-apache-hive/9.1.3/>`_.
94
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-apache-hive/9.2.3/>`_.
93
95
 
94
96
  Installation
95
97
  ------------
@@ -106,14 +108,13 @@ Requirements
106
108
  ========================================== =====================================
107
109
  PIP package Version required
108
110
  ========================================== =====================================
109
- ``apache-airflow`` ``>=2.10.0``
110
- ``apache-airflow-providers-common-compat`` ``>=1.7.4``
111
+ ``apache-airflow`` ``>=2.11.0``
112
+ ``apache-airflow-providers-common-compat`` ``>=1.10.1``
111
113
  ``apache-airflow-providers-common-sql`` ``>=1.26.0``
112
114
  ``hmsclient`` ``>=0.1.0``
113
115
  ``pandas`` ``>=2.1.2; python_version < "3.13"``
114
116
  ``pandas`` ``>=2.2.3; python_version >= "3.13"``
115
117
  ``pyhive[hive_pure_sasl]`` ``>=0.7.0``
116
- ``thrift`` ``>=0.11.0``
117
118
  ``jmespath`` ``>=0.7.0``
118
119
  ========================================== =====================================
119
120
 
@@ -134,6 +135,7 @@ You can install such cross-provider dependencies when installing from PyPI. For
134
135
  Dependent package Extra
135
136
  ====================================================================================================================== ===================
136
137
  `apache-airflow-providers-amazon <https://airflow.apache.org/docs/apache-airflow-providers-amazon>`_ ``amazon``
138
+ `apache-airflow-providers-common-compat <https://airflow.apache.org/docs/apache-airflow-providers-common-compat>`_ ``common.compat``
137
139
  `apache-airflow-providers-common-sql <https://airflow.apache.org/docs/apache-airflow-providers-common-sql>`_ ``common.sql``
138
140
  `apache-airflow-providers-microsoft-mssql <https://airflow.apache.org/docs/apache-airflow-providers-microsoft-mssql>`_ ``microsoft.mssql``
139
141
  `apache-airflow-providers-mysql <https://airflow.apache.org/docs/apache-airflow-providers-mysql>`_ ``mysql``
@@ -145,18 +147,19 @@ Dependent package
145
147
  Optional dependencies
146
148
  ----------------------
147
149
 
148
- =================== ============================================
150
+ =================== =============================================================================================
149
151
  Extra Dependencies
150
- =================== ============================================
152
+ =================== =============================================================================================
151
153
  ``amazon`` ``apache-airflow-providers-amazon``
152
154
  ``microsoft.mssql`` ``apache-airflow-providers-microsoft-mssql``
153
155
  ``mysql`` ``apache-airflow-providers-mysql``
154
156
  ``presto`` ``apache-airflow-providers-presto``
155
157
  ``samba`` ``apache-airflow-providers-samba``
156
158
  ``vertica`` ``apache-airflow-providers-vertica``
159
+ ``GSSAPI`` ``winkerberos>=0.7.0; sys_platform == "win32"``, ``kerberos>=1.3.0; sys_platform != "win32"``
157
160
  ``common.compat`` ``apache-airflow-providers-common-compat``
158
- =================== ============================================
161
+ =================== =============================================================================================
159
162
 
160
163
  The changelog for the provider package can be found in the
161
- `changelog <https://airflow.apache.org/docs/apache-airflow-providers-apache-hive/9.1.3/changelog.html>`_.
164
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-apache-hive/9.2.3/changelog.html>`_.
162
165
 
@@ -1,16 +1,15 @@
1
- airflow/providers/apache/hive/LICENSE,sha256=gXPVwptPlW1TJ4HSuG5OMPg-a3h43OGMkZRR1rpwfJA,10850
2
- airflow/providers/apache/hive/__init__.py,sha256=agFgo_XRmaHGNjcsHBhmlUYJo8UggvlWpYH3qF6Klbo,1500
1
+ airflow/providers/apache/hive/__init__.py,sha256=AIRaho8E0eXv4-qr_SRzPwAMGzDu83pr7Q_LRiAzi8w,1500
3
2
  airflow/providers/apache/hive/get_provider_info.py,sha256=PdxdiZ7fdK1D-BTyZqj1oMS_1GS8_kbz2hZVgWMTkFI,5569
4
3
  airflow/providers/apache/hive/version_compat.py,sha256=_GXtl-AYDBq0f1jpNovs_Vw1QwHZsXbHuWE8FVAOrT4,2011
5
4
  airflow/providers/apache/hive/hooks/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
6
- airflow/providers/apache/hive/hooks/hive.py,sha256=cE94TbK7ckbW9M4Q1IJcFZEYHqlhA0EviveR7pbHz_Y,44796
5
+ airflow/providers/apache/hive/hooks/hive.py,sha256=xwojnDN9FJxJL1jNGVN0y6gHOY8Wa6bZ6O9x3yWroeg,45571
7
6
  airflow/providers/apache/hive/macros/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
8
7
  airflow/providers/apache/hive/macros/hive.py,sha256=FEMCR9rEWKFOKtKAvhVWhD5jRJnSYeHepVGgJLzUa2k,4548
9
8
  airflow/providers/apache/hive/operators/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
10
- airflow/providers/apache/hive/operators/hive.py,sha256=YO_Q3l-SskEqAUhPdmpimZsuNbSXF1l3bwb42MC5oRU,7517
11
- airflow/providers/apache/hive/operators/hive_stats.py,sha256=QYkdUPu_FKh2n791yW278hOIgTHRGAKEs19t0ZaWiRw,7109
9
+ airflow/providers/apache/hive/operators/hive.py,sha256=a7iO0qNh51Has29DLXFufKWMktwumcbTYqDFAMh_Nk8,7488
10
+ airflow/providers/apache/hive/operators/hive_stats.py,sha256=-w2UHZPz8EVakz_tXHAyHe5FiW_7w0ImFFrhy7R3LEQ,7079
12
11
  airflow/providers/apache/hive/plugins/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
13
- airflow/providers/apache/hive/plugins/hive.py,sha256=rrGccro6DEdnHSmII3goBYD9te-XdhPaPMjWpF-36HU,1146
12
+ airflow/providers/apache/hive/plugins/hive.py,sha256=szo1XlCqccG4TNQl0krFVCVt_jL5vOVm4KhALXrH7Rk,1158
14
13
  airflow/providers/apache/hive/sensors/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
15
14
  airflow/providers/apache/hive/sensors/hive_partition.py,sha256=j7TVA-ZAGDVpi6HpuaAwSr_PBMz-v3Qf7SzNeCwwI4Q,3095
16
15
  airflow/providers/apache/hive/sensors/metastore_partition.py,sha256=x0X9xt50cIQucfi2-4p30C17CUQgEQqyWI7npW50YJQ,3379
@@ -20,9 +19,11 @@ airflow/providers/apache/hive/transfers/hive_to_mysql.py,sha256=SOV3soZX-KmtEjWU
20
19
  airflow/providers/apache/hive/transfers/hive_to_samba.py,sha256=i9d9BV4bfUr5DabSB5UpOJ5S60Gz17smJnK96Vkhqlc,3003
21
20
  airflow/providers/apache/hive/transfers/mssql_to_hive.py,sha256=w-B1hqVzCGPex6-KlaPyEK4bePYFpZkVrl3z1r4dQWI,5791
22
21
  airflow/providers/apache/hive/transfers/mysql_to_hive.py,sha256=Q-qJ3sX75RGzYpbU_RXVo6HBKkFeig0-agbr6uG3HsA,7067
23
- airflow/providers/apache/hive/transfers/s3_to_hive.py,sha256=lZ2TcAJJkNpP84nxrTZJ1mqNeCS_7PRC0CPNAVtEQj8,12452
22
+ airflow/providers/apache/hive/transfers/s3_to_hive.py,sha256=PLqh8Z90OrFvY2TDZR7GGNc1_AKQuAKiF6J6WPJh5-0,12422
24
23
  airflow/providers/apache/hive/transfers/vertica_to_hive.py,sha256=W2sDdp9nfYjr-FYK-v3t33BM0yD_GRqgp8JXuCaXqrY,5590
25
- apache_airflow_providers_apache_hive-9.1.3rc1.dist-info/entry_points.txt,sha256=Hzixt33mYYldwmwswarArUB7ZU0xbmUtd3tFViZ414s,185
26
- apache_airflow_providers_apache_hive-9.1.3rc1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
27
- apache_airflow_providers_apache_hive-9.1.3rc1.dist-info/METADATA,sha256=U0Lreh9EmiReBNUVFYngKlt4acVPXIbFNC4grBTpLyQ,8160
28
- apache_airflow_providers_apache_hive-9.1.3rc1.dist-info/RECORD,,
24
+ apache_airflow_providers_apache_hive-9.2.3rc1.dist-info/entry_points.txt,sha256=Hzixt33mYYldwmwswarArUB7ZU0xbmUtd3tFViZ414s,185
25
+ apache_airflow_providers_apache_hive-9.2.3rc1.dist-info/licenses/LICENSE,sha256=gXPVwptPlW1TJ4HSuG5OMPg-a3h43OGMkZRR1rpwfJA,10850
26
+ apache_airflow_providers_apache_hive-9.2.3rc1.dist-info/licenses/NOTICE,sha256=_cWHznIoUSbLCY_KfmKqetlKlsoH0c2VBjmZjElAzuc,168
27
+ apache_airflow_providers_apache_hive-9.2.3rc1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
28
+ apache_airflow_providers_apache_hive-9.2.3rc1.dist-info/METADATA,sha256=j6fiwV-nnCjqELgXBDGo3P44R5GK91gc8oGbTcLpD2s,8565
29
+ apache_airflow_providers_apache_hive-9.2.3rc1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Apache Airflow
2
+ Copyright 2016-2026 The Apache Software Foundation
3
+
4
+ This product includes software developed at
5
+ The Apache Software Foundation (http://www.apache.org/).