Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion providers/elasticsearch/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Requirements
PIP package Version required
======================================= ==================
``apache-airflow`` ``>=2.10.0``
``apache-airflow-providers-common-sql`` ``>=1.26.0``
``apache-airflow-providers-common-sql`` ``>=1.27.0``
``elasticsearch`` ``>=8.10,<9``
======================================= ==================

Expand Down
2 changes: 1 addition & 1 deletion providers/elasticsearch/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ requires-python = "~=3.9"
# After you modify the dependencies, and rebuild your Breeze CI image with ``breeze ci-image build``
dependencies = [
"apache-airflow>=2.10.0",
"apache-airflow-providers-common-sql>=1.26.0",
"apache-airflow-providers-common-sql>=1.27.0",
"elasticsearch>=8.10,<9",
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,17 @@ def get_uri(self) -> str:

return uri

def _get_polars_df(
self,
sql,
parameters: list | tuple | Mapping[str, Any] | None = None,
**kwargs,
):
# TODO: Custom ElasticsearchSQLCursor is incompatible with polars.read_database.
# To support: either adapt cursor to polars._executor interface or create custom polars reader.
# https://github.com/apache/airflow/pull/50454
raise NotImplementedError("Polars is not supported for Elasticsearch")


class ElasticsearchPythonHook(BaseHook):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ def test_get_df_pandas(self):
self.spy_agency.assert_spy_called(self.cur.close)
self.spy_agency.assert_spy_called(self.cur.execute)

def test_get_df_polars(self):
with pytest.raises(NotImplementedError):
self.db_hook.get_df("SQL", df_type="polars")

def test_run(self):
statement = "SELECT * FROM hollywood.actors"

Expand Down