apache-airflow-providers-elasticsearch 6.3.2rc1__py3-none-any.whl → 6.3.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,7 +29,7 @@ from airflow import __version__ as airflow_version
29
29
 
30
30
  __all__ = ["__version__"]
31
31
 
32
- __version__ = "6.3.2"
32
+ __version__ = "6.3.3"
33
33
 
34
34
  if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
35
35
  "2.10.0"
@@ -41,17 +41,23 @@ from elasticsearch.exceptions import NotFoundError
41
41
  from airflow.configuration import conf
42
42
  from airflow.exceptions import AirflowException
43
43
  from airflow.models.dagrun import DagRun
44
- from airflow.providers.elasticsearch.log.es_json_formatter import (
45
- ElasticsearchJSONFormatter,
46
- )
44
+ from airflow.providers.elasticsearch.log.es_json_formatter import ElasticsearchJSONFormatter
47
45
  from airflow.providers.elasticsearch.log.es_response import ElasticSearchResponse, Hit
48
- from airflow.providers.elasticsearch.version_compat import AIRFLOW_V_3_0_PLUS, EsLogMsgType
49
- from airflow.utils import timezone
46
+ from airflow.providers.elasticsearch.version_compat import (
47
+ AIRFLOW_V_3_0_PLUS,
48
+ AIRFLOW_V_3_1_PLUS,
49
+ EsLogMsgType,
50
+ )
50
51
  from airflow.utils.log.file_task_handler import FileTaskHandler
51
52
  from airflow.utils.log.logging_mixin import ExternalLoggingMixin, LoggingMixin
52
53
  from airflow.utils.module_loading import import_string
53
54
  from airflow.utils.session import create_session
54
55
 
56
+ if AIRFLOW_V_3_1_PLUS:
57
+ from airflow.sdk import timezone
58
+ else:
59
+ from airflow.utils import timezone # type: ignore[attr-defined,no-redef]
60
+
55
61
  if TYPE_CHECKING:
56
62
  from datetime import datetime
57
63
 
@@ -156,13 +162,19 @@ class ElasticsearchTaskHandler(FileTaskHandler, ExternalLoggingMixin, LoggingMix
156
162
  index_patterns: str = conf.get("elasticsearch", "index_patterns"),
157
163
  index_patterns_callable: str = conf.get("elasticsearch", "index_patterns_callable", fallback=""),
158
164
  es_kwargs: dict | None | Literal["default_es_kwargs"] = "default_es_kwargs",
165
+ max_bytes: int = 0,
166
+ backup_count: int = 0,
167
+ delay: bool = False,
159
168
  **kwargs,
160
- ):
169
+ ) -> None:
161
170
  es_kwargs = es_kwargs or {}
162
171
  if es_kwargs == "default_es_kwargs":
163
172
  es_kwargs = get_es_kwargs_from_config()
164
173
  self.host = self.format_url(host)
165
- super().__init__(base_log_folder)
174
+ # support log file size handling of FileTaskHandler
175
+ super().__init__(
176
+ base_log_folder=base_log_folder, max_bytes=max_bytes, backup_count=backup_count, delay=delay
177
+ )
166
178
  self.closed = False
167
179
 
168
180
  self.client = elasticsearch.Elasticsearch(self.host, **es_kwargs)
@@ -235,29 +247,17 @@ class ElasticsearchTaskHandler(FileTaskHandler, ExternalLoggingMixin, LoggingMix
235
247
  if USE_PER_RUN_LOG_ID:
236
248
  log_id_template = dag_run.get_log_template(session=session).elasticsearch_id
237
249
 
238
- if TYPE_CHECKING:
239
- assert ti.task
240
- try:
241
- dag = ti.task.dag
242
- except AttributeError: # ti.task is not always set.
243
- data_interval = (dag_run.data_interval_start, dag_run.data_interval_end)
244
- else:
245
- if TYPE_CHECKING:
246
- assert dag is not None
247
- # TODO: Task-SDK: Where should this function be?
248
- data_interval = dag.get_run_data_interval(dag_run) # type: ignore[attr-defined]
249
-
250
250
  if self.json_format:
251
- data_interval_start = self._clean_date(data_interval[0])
252
- data_interval_end = self._clean_date(data_interval[1])
251
+ data_interval_start = self._clean_date(dag_run.data_interval_start)
252
+ data_interval_end = self._clean_date(dag_run.data_interval_end)
253
253
  logical_date = self._clean_date(dag_run.logical_date)
254
254
  else:
255
- if data_interval[0]:
256
- data_interval_start = data_interval[0].isoformat()
255
+ if dag_run.data_interval_start:
256
+ data_interval_start = dag_run.data_interval_start.isoformat()
257
257
  else:
258
258
  data_interval_start = ""
259
- if data_interval[1]:
260
- data_interval_end = data_interval[1].isoformat()
259
+ if dag_run.data_interval_end:
260
+ data_interval_end = dag_run.data_interval_end.isoformat()
261
261
  else:
262
262
  data_interval_end = ""
263
263
  logical_date = dag_run.logical_date.isoformat()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apache-airflow-providers-elasticsearch
3
- Version: 6.3.2rc1
3
+ Version: 6.3.3rc1
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>
@@ -24,8 +24,8 @@ Requires-Dist: apache-airflow>=2.10.0rc1
24
24
  Requires-Dist: apache-airflow-providers-common-sql>=1.27.0rc1
25
25
  Requires-Dist: elasticsearch>=8.10,<9
26
26
  Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
27
- Project-URL: Changelog, https://airflow.staged.apache.org/docs/apache-airflow-providers-elasticsearch/6.3.2/changelog.html
28
- Project-URL: Documentation, https://airflow.staged.apache.org/docs/apache-airflow-providers-elasticsearch/6.3.2
27
+ Project-URL: Changelog, https://airflow.staged.apache.org/docs/apache-airflow-providers-elasticsearch/6.3.3/changelog.html
28
+ Project-URL: Documentation, https://airflow.staged.apache.org/docs/apache-airflow-providers-elasticsearch/6.3.3
29
29
  Project-URL: Mastodon, https://fosstodon.org/@airflow
30
30
  Project-URL: Slack Chat, https://s.apache.org/airflow-slack
31
31
  Project-URL: Source Code, https://github.com/apache/airflow
@@ -56,9 +56,8 @@ Project-URL: YouTube, https://www.youtube.com/channel/UCSXwxpWZQ7XZ1WL3wqevChA/
56
56
 
57
57
  Package ``apache-airflow-providers-elasticsearch``
58
58
 
59
- Release: ``6.3.2``
59
+ Release: ``6.3.3``
60
60
 
61
- Release Date: ``|PypiReleaseDate|``
62
61
 
63
62
  `Elasticsearch <https://www.elastic.co/elasticsearch>`__
64
63
 
@@ -70,12 +69,12 @@ This is a provider package for ``elasticsearch`` provider. All classes for this
70
69
  are in ``airflow.providers.elasticsearch`` python package.
71
70
 
72
71
  You can find package information and changelog for the provider
73
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-elasticsearch/6.3.2/>`_.
72
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-elasticsearch/6.3.3/>`_.
74
73
 
75
74
  Installation
76
75
  ------------
77
76
 
78
- You can install this package on top of an existing Airflow 2 installation (see ``Requirements`` below
77
+ You can install this package on top of an existing Airflow installation (see ``Requirements`` below
79
78
  for the minimum Airflow version supported) via
80
79
  ``pip install apache-airflow-providers-elasticsearch``
81
80
 
@@ -112,5 +111,5 @@ Dependent package
112
111
  ============================================================================================================ ==============
113
112
 
114
113
  The changelog for the provider package can be found in the
115
- `changelog <https://airflow.apache.org/docs/apache-airflow-providers-elasticsearch/6.3.2/changelog.html>`_.
114
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-elasticsearch/6.3.3/changelog.html>`_.
116
115
 
@@ -1,5 +1,5 @@
1
1
  airflow/providers/elasticsearch/LICENSE,sha256=gXPVwptPlW1TJ4HSuG5OMPg-a3h43OGMkZRR1rpwfJA,10850
2
- airflow/providers/elasticsearch/__init__.py,sha256=QyVuquS4SFu8rW3mF_Z6J8B-_xBf749nRxohrJ4Fp7Y,1502
2
+ airflow/providers/elasticsearch/__init__.py,sha256=x495Pa_35IYEeA-WPMUxKf5d-7YDI0SyFMbc4pnQSFE,1502
3
3
  airflow/providers/elasticsearch/get_provider_info.py,sha256=473iBNJ4Kiy-DvbOa6CqDOS3pPEs6x7WBwkhR1QTuiw,8106
4
4
  airflow/providers/elasticsearch/version_compat.py,sha256=VoYY99deuWiC8ya1zauXtFNSb6MBplEtBvc6zAgb6oM,2073
5
5
  airflow/providers/elasticsearch/hooks/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
@@ -7,8 +7,8 @@ airflow/providers/elasticsearch/hooks/elasticsearch.py,sha256=hHbNKnsy8bNHjV-ufZ
7
7
  airflow/providers/elasticsearch/log/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
8
8
  airflow/providers/elasticsearch/log/es_json_formatter.py,sha256=DwWPDJtZLr_6Mdae1-XVEgmE1XErFIanSzxWovs50ig,1796
9
9
  airflow/providers/elasticsearch/log/es_response.py,sha256=LdMBuVBTydaC42HooYSttAjTK-CpPA4r_KHl38msMnk,6046
10
- airflow/providers/elasticsearch/log/es_task_handler.py,sha256=nqjmWbHkXNfroDeQn611jMOODpLKNuCA-SUkJ1QwLM8,28928
11
- apache_airflow_providers_elasticsearch-6.3.2rc1.dist-info/entry_points.txt,sha256=jpgAUVmTsdtWQ4nru2FJQKP9JBN4OPHK-ybfYc3_BOs,109
12
- apache_airflow_providers_elasticsearch-6.3.2rc1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
13
- apache_airflow_providers_elasticsearch-6.3.2rc1.dist-info/METADATA,sha256=UzfRK9H0NpxJISrq9PVhpDJjn3uxJ_WpA1ydbQDgNE4,5278
14
- apache_airflow_providers_elasticsearch-6.3.2rc1.dist-info/RECORD,,
10
+ airflow/providers/elasticsearch/log/es_task_handler.py,sha256=wGc0M4SVOKtfI22I_CCfKT56K2eE-qDV22MgKe7vbZs,28901
11
+ apache_airflow_providers_elasticsearch-6.3.3rc1.dist-info/entry_points.txt,sha256=jpgAUVmTsdtWQ4nru2FJQKP9JBN4OPHK-ybfYc3_BOs,109
12
+ apache_airflow_providers_elasticsearch-6.3.3rc1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
13
+ apache_airflow_providers_elasticsearch-6.3.3rc1.dist-info/METADATA,sha256=0QVX5j09YwKoIpZ1CbKtfeOdJwRgaD9O1Uim19mu6js,5240
14
+ apache_airflow_providers_elasticsearch-6.3.3rc1.dist-info/RECORD,,