apache-airflow-providers-elasticsearch 5.4.0rc1__tar.gz → 5.4.0rc2__tar.gz
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.
Potentially problematic release.
This version of apache-airflow-providers-elasticsearch might be problematic. Click here for more details.
- {apache_airflow_providers_elasticsearch-5.4.0rc1 → apache_airflow_providers_elasticsearch-5.4.0rc2}/PKG-INFO +7 -6
- {apache_airflow_providers_elasticsearch-5.4.0rc1 → apache_airflow_providers_elasticsearch-5.4.0rc2}/README.rst +3 -3
- {apache_airflow_providers_elasticsearch-5.4.0rc1 → apache_airflow_providers_elasticsearch-5.4.0rc2}/airflow/providers/elasticsearch/__init__.py +2 -2
- {apache_airflow_providers_elasticsearch-5.4.0rc1 → apache_airflow_providers_elasticsearch-5.4.0rc2}/airflow/providers/elasticsearch/get_provider_info.py +5 -2
- {apache_airflow_providers_elasticsearch-5.4.0rc1 → apache_airflow_providers_elasticsearch-5.4.0rc2}/airflow/providers/elasticsearch/hooks/elasticsearch.py +7 -9
- {apache_airflow_providers_elasticsearch-5.4.0rc1 → apache_airflow_providers_elasticsearch-5.4.0rc2}/airflow/providers/elasticsearch/log/es_json_formatter.py +5 -1
- {apache_airflow_providers_elasticsearch-5.4.0rc1 → apache_airflow_providers_elasticsearch-5.4.0rc2}/airflow/providers/elasticsearch/log/es_response.py +8 -0
- {apache_airflow_providers_elasticsearch-5.4.0rc1 → apache_airflow_providers_elasticsearch-5.4.0rc2}/airflow/providers/elasticsearch/log/es_task_handler.py +2 -0
- {apache_airflow_providers_elasticsearch-5.4.0rc1 → apache_airflow_providers_elasticsearch-5.4.0rc2}/pyproject.toml +4 -3
- {apache_airflow_providers_elasticsearch-5.4.0rc1 → apache_airflow_providers_elasticsearch-5.4.0rc2}/airflow/providers/elasticsearch/LICENSE +0 -0
- {apache_airflow_providers_elasticsearch-5.4.0rc1 → apache_airflow_providers_elasticsearch-5.4.0rc2}/airflow/providers/elasticsearch/hooks/__init__.py +0 -0
- {apache_airflow_providers_elasticsearch-5.4.0rc1 → apache_airflow_providers_elasticsearch-5.4.0rc2}/airflow/providers/elasticsearch/log/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: apache-airflow-providers-elasticsearch
|
|
3
|
-
Version: 5.4.
|
|
3
|
+
Version: 5.4.0rc2
|
|
4
4
|
Summary: Provider package apache-airflow-providers-elasticsearch for Apache Airflow
|
|
5
5
|
Keywords: airflow-provider,elasticsearch,airflow,integration
|
|
6
6
|
Author-email: Apache Software Foundation <dev@airflow.apache.org>
|
|
@@ -19,9 +19,10 @@ Classifier: Programming Language :: Python :: 3.8
|
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.9
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.10
|
|
21
21
|
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
23
|
Classifier: Topic :: System :: Monitoring
|
|
23
|
-
Requires-Dist: apache-airflow-providers-common-sql>=1.3.
|
|
24
|
-
Requires-Dist: apache-airflow>=2.
|
|
24
|
+
Requires-Dist: apache-airflow-providers-common-sql>=1.3.1rc0
|
|
25
|
+
Requires-Dist: apache-airflow>=2.7.0rc0
|
|
25
26
|
Requires-Dist: elasticsearch>=8.10,<9
|
|
26
27
|
Requires-Dist: apache-airflow-providers-common-sql ; extra == "common.sql"
|
|
27
28
|
Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
|
|
@@ -77,7 +78,7 @@ Provides-Extra: common.sql
|
|
|
77
78
|
|
|
78
79
|
Package ``apache-airflow-providers-elasticsearch``
|
|
79
80
|
|
|
80
|
-
Release: ``5.4.0.
|
|
81
|
+
Release: ``5.4.0.rc2``
|
|
81
82
|
|
|
82
83
|
|
|
83
84
|
`Elasticsearch <https://www.elastic.co/elasticsearch>`__
|
|
@@ -99,7 +100,7 @@ You can install this package on top of an existing Airflow 2 installation (see `
|
|
|
99
100
|
for the minimum Airflow version supported) via
|
|
100
101
|
``pip install apache-airflow-providers-elasticsearch``
|
|
101
102
|
|
|
102
|
-
The package supports the following python versions: 3.8,3.9,3.10,3.11
|
|
103
|
+
The package supports the following python versions: 3.8,3.9,3.10,3.11,3.12
|
|
103
104
|
|
|
104
105
|
Requirements
|
|
105
106
|
------------
|
|
@@ -107,7 +108,7 @@ Requirements
|
|
|
107
108
|
======================================= ==================
|
|
108
109
|
PIP package Version required
|
|
109
110
|
======================================= ==================
|
|
110
|
-
``apache-airflow`` ``>=2.
|
|
111
|
+
``apache-airflow`` ``>=2.7.0``
|
|
111
112
|
``apache-airflow-providers-common-sql`` ``>=1.3.1``
|
|
112
113
|
``elasticsearch`` ``>=8.10,<9``
|
|
113
114
|
======================================= ==================
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
|
|
43
43
|
Package ``apache-airflow-providers-elasticsearch``
|
|
44
44
|
|
|
45
|
-
Release: ``5.4.0.
|
|
45
|
+
Release: ``5.4.0.rc2``
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
`Elasticsearch <https://www.elastic.co/elasticsearch>`__
|
|
@@ -64,7 +64,7 @@ You can install this package on top of an existing Airflow 2 installation (see `
|
|
|
64
64
|
for the minimum Airflow version supported) via
|
|
65
65
|
``pip install apache-airflow-providers-elasticsearch``
|
|
66
66
|
|
|
67
|
-
The package supports the following python versions: 3.8,3.9,3.10,3.11
|
|
67
|
+
The package supports the following python versions: 3.8,3.9,3.10,3.11,3.12
|
|
68
68
|
|
|
69
69
|
Requirements
|
|
70
70
|
------------
|
|
@@ -72,7 +72,7 @@ Requirements
|
|
|
72
72
|
======================================= ==================
|
|
73
73
|
PIP package Version required
|
|
74
74
|
======================================= ==================
|
|
75
|
-
``apache-airflow`` ``>=2.
|
|
75
|
+
``apache-airflow`` ``>=2.7.0``
|
|
76
76
|
``apache-airflow-providers-common-sql`` ``>=1.3.1``
|
|
77
77
|
``elasticsearch`` ``>=8.10,<9``
|
|
78
78
|
======================================= ==================
|
|
@@ -35,8 +35,8 @@ except ImportError:
|
|
|
35
35
|
from airflow.version import version as airflow_version
|
|
36
36
|
|
|
37
37
|
if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
|
|
38
|
-
"2.
|
|
38
|
+
"2.7.0"
|
|
39
39
|
):
|
|
40
40
|
raise RuntimeError(
|
|
41
|
-
f"The package `apache-airflow-providers-elasticsearch:{__version__}` needs Apache Airflow 2.
|
|
41
|
+
f"The package `apache-airflow-providers-elasticsearch:{__version__}` needs Apache Airflow 2.7.0+"
|
|
42
42
|
)
|
|
@@ -28,9 +28,12 @@ def get_provider_info():
|
|
|
28
28
|
"name": "Elasticsearch",
|
|
29
29
|
"description": "`Elasticsearch <https://www.elastic.co/elasticsearch>`__\n",
|
|
30
30
|
"state": "ready",
|
|
31
|
-
"source-date-epoch":
|
|
31
|
+
"source-date-epoch": 1714476311,
|
|
32
32
|
"versions": [
|
|
33
33
|
"5.4.0",
|
|
34
|
+
"5.3.4",
|
|
35
|
+
"5.3.3",
|
|
36
|
+
"5.3.2",
|
|
34
37
|
"5.3.1",
|
|
35
38
|
"5.3.0",
|
|
36
39
|
"5.2.0",
|
|
@@ -66,7 +69,7 @@ def get_provider_info():
|
|
|
66
69
|
"1.0.0",
|
|
67
70
|
],
|
|
68
71
|
"dependencies": [
|
|
69
|
-
"apache-airflow>=2.
|
|
72
|
+
"apache-airflow>=2.7.0",
|
|
70
73
|
"apache-airflow-providers-common-sql>=1.3.1",
|
|
71
74
|
"elasticsearch>=8.10,<9",
|
|
72
75
|
],
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
# under the License.
|
|
18
18
|
from __future__ import annotations
|
|
19
19
|
|
|
20
|
-
import warnings
|
|
21
20
|
from functools import cached_property
|
|
22
21
|
from typing import TYPE_CHECKING, Any
|
|
23
22
|
from urllib import parse
|
|
24
23
|
|
|
24
|
+
from deprecated import deprecated
|
|
25
25
|
from elasticsearch import Elasticsearch
|
|
26
26
|
|
|
27
27
|
from airflow.exceptions import AirflowProviderDeprecationWarning
|
|
@@ -138,6 +138,10 @@ class ElasticsearchSQLHook(DbApiHook):
|
|
|
138
138
|
return uri
|
|
139
139
|
|
|
140
140
|
|
|
141
|
+
@deprecated(
|
|
142
|
+
reason="Please use `airflow.providers.elasticsearch.hooks.elasticsearch.ElasticsearchSQLHook`.",
|
|
143
|
+
category=AirflowProviderDeprecationWarning,
|
|
144
|
+
)
|
|
141
145
|
class ElasticsearchHook(ElasticsearchSQLHook):
|
|
142
146
|
"""
|
|
143
147
|
This class is deprecated and was renamed to ElasticsearchSQLHook.
|
|
@@ -146,12 +150,6 @@ class ElasticsearchHook(ElasticsearchSQLHook):
|
|
|
146
150
|
"""
|
|
147
151
|
|
|
148
152
|
def __init__(self, *args, **kwargs):
|
|
149
|
-
warnings.warn(
|
|
150
|
-
"""This class is deprecated.
|
|
151
|
-
Please use `airflow.providers.elasticsearch.hooks.elasticsearch.ElasticsearchSQLHook`.""",
|
|
152
|
-
AirflowProviderDeprecationWarning,
|
|
153
|
-
stacklevel=3,
|
|
154
|
-
)
|
|
155
153
|
super().__init__(*args, **kwargs)
|
|
156
154
|
|
|
157
155
|
|
|
@@ -164,8 +162,8 @@ class ElasticsearchPythonHook(BaseHook):
|
|
|
164
162
|
Example: {"ca_cert":"/path/to/cert", "basic_auth": "(user, pass)"}
|
|
165
163
|
"""
|
|
166
164
|
|
|
167
|
-
def __init__(self, hosts: list[Any], es_conn_args: dict | None = None
|
|
168
|
-
super().__init__(
|
|
165
|
+
def __init__(self, hosts: list[Any], es_conn_args: dict | None = None):
|
|
166
|
+
super().__init__()
|
|
169
167
|
self.hosts = hosts
|
|
170
168
|
self.es_conn_args = es_conn_args or {}
|
|
171
169
|
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
# under the License.
|
|
17
17
|
from __future__ import annotations
|
|
18
18
|
|
|
19
|
+
from datetime import datetime
|
|
20
|
+
|
|
19
21
|
import pendulum
|
|
20
22
|
|
|
21
23
|
from airflow.utils.log.json_formatter import JSONFormatter
|
|
@@ -30,7 +32,9 @@ class ElasticsearchJSONFormatter(JSONFormatter):
|
|
|
30
32
|
|
|
31
33
|
def formatTime(self, record, datefmt=None):
|
|
32
34
|
"""Return the creation time of the LogRecord in ISO 8601 date/time format in the local time zone."""
|
|
33
|
-
|
|
35
|
+
# TODO: Use airflow.utils.timezone.from_timestamp(record.created, tz="local")
|
|
36
|
+
# as soon as min Airflow 2.9.0
|
|
37
|
+
dt = datetime.fromtimestamp(record.created, tz=pendulum.local_timezone())
|
|
34
38
|
s = dt.strftime(datefmt or self.default_time_format)
|
|
35
39
|
if self.default_msec_format:
|
|
36
40
|
s = self.default_msec_format % (s, record.msecs)
|
|
@@ -34,15 +34,18 @@ class AttributeList:
|
|
|
34
34
|
self._l_ = _list
|
|
35
35
|
|
|
36
36
|
def __getitem__(self, k):
|
|
37
|
+
"""Retrieve an item or a slice from the list. If the item is a dictionary, it is wrapped in an AttributeDict."""
|
|
37
38
|
val = self._l_[k]
|
|
38
39
|
if isinstance(val, slice):
|
|
39
40
|
return AttributeList(val)
|
|
40
41
|
return _wrap(val)
|
|
41
42
|
|
|
42
43
|
def __iter__(self):
|
|
44
|
+
"""Provide an iterator for the list or the dictionary."""
|
|
43
45
|
return (_wrap(i) for i in self._l_)
|
|
44
46
|
|
|
45
47
|
def __bool__(self):
|
|
48
|
+
"""Check if the list is non-empty."""
|
|
46
49
|
return bool(self._l_)
|
|
47
50
|
|
|
48
51
|
|
|
@@ -53,12 +56,14 @@ class AttributeDict:
|
|
|
53
56
|
super().__setattr__("_d_", d)
|
|
54
57
|
|
|
55
58
|
def __getattr__(self, attr_name):
|
|
59
|
+
"""Retrieve an item as an attribute from the dictionary."""
|
|
56
60
|
try:
|
|
57
61
|
return self.__getitem__(attr_name)
|
|
58
62
|
except KeyError:
|
|
59
63
|
raise AttributeError(f"{self.__class__.__name__!r} object has no attribute {attr_name!r}")
|
|
60
64
|
|
|
61
65
|
def __getitem__(self, key):
|
|
66
|
+
"""Retrieve an item using a key from the dictionary."""
|
|
62
67
|
return _wrap(self._d_[key])
|
|
63
68
|
|
|
64
69
|
def to_dict(self):
|
|
@@ -120,14 +125,17 @@ class ElasticSearchResponse(AttributeDict):
|
|
|
120
125
|
super().__init__(response)
|
|
121
126
|
|
|
122
127
|
def __iter__(self) -> Iterator[Hit]:
|
|
128
|
+
"""Provide an iterator over the hits in the Elasticsearch response."""
|
|
123
129
|
return iter(self.hits)
|
|
124
130
|
|
|
125
131
|
def __getitem__(self, key):
|
|
132
|
+
"""Retrieve a specific hit or a slice of hits from the Elasticsearch response."""
|
|
126
133
|
if isinstance(key, (slice, int)):
|
|
127
134
|
return self.hits[key]
|
|
128
135
|
return super().__getitem__(key)
|
|
129
136
|
|
|
130
137
|
def __bool__(self):
|
|
138
|
+
"""Evaluate the presence of hits in the Elasticsearch response."""
|
|
131
139
|
return bool(self.hits)
|
|
132
140
|
|
|
133
141
|
@property
|
|
@@ -225,6 +225,8 @@ class ElasticsearchTaskHandler(FileTaskHandler, ExternalLoggingMixin, LoggingMix
|
|
|
225
225
|
else:
|
|
226
226
|
log_id_template = self.log_id_template
|
|
227
227
|
|
|
228
|
+
if TYPE_CHECKING:
|
|
229
|
+
assert ti.task
|
|
228
230
|
try:
|
|
229
231
|
dag = ti.task.dag
|
|
230
232
|
except AttributeError: # ti.task is not always set.
|
|
@@ -28,7 +28,7 @@ build-backend = "flit_core.buildapi"
|
|
|
28
28
|
|
|
29
29
|
[project]
|
|
30
30
|
name = "apache-airflow-providers-elasticsearch"
|
|
31
|
-
version = "5.4.0.
|
|
31
|
+
version = "5.4.0.rc2"
|
|
32
32
|
description = "Provider package apache-airflow-providers-elasticsearch for Apache Airflow"
|
|
33
33
|
readme = "README.rst"
|
|
34
34
|
authors = [
|
|
@@ -51,12 +51,13 @@ classifiers = [
|
|
|
51
51
|
"Programming Language :: Python :: 3.9",
|
|
52
52
|
"Programming Language :: Python :: 3.10",
|
|
53
53
|
"Programming Language :: Python :: 3.11",
|
|
54
|
+
"Programming Language :: Python :: 3.12",
|
|
54
55
|
"Topic :: System :: Monitoring",
|
|
55
56
|
]
|
|
56
57
|
requires-python = "~=3.8"
|
|
57
58
|
dependencies = [
|
|
58
|
-
"apache-airflow-providers-common-sql>=1.3.
|
|
59
|
-
"apache-airflow>=2.
|
|
59
|
+
"apache-airflow-providers-common-sql>=1.3.1rc0",
|
|
60
|
+
"apache-airflow>=2.7.0rc0",
|
|
60
61
|
"elasticsearch>=8.10,<9",
|
|
61
62
|
]
|
|
62
63
|
|
|
File without changes
|
|
File without changes
|