SameerMesiah97 commented on code in PR #66220:
URL: https://github.com/apache/airflow/pull/66220#discussion_r3319958350
##########
providers/elasticsearch/tests/unit/elasticsearch/hooks/test_elasticsearch.py:
##########
@@ -253,9 +253,21 @@ 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")
+
@mock.patch("airflow.providers.elasticsearch.hooks.elasticsearch.read_elasticsearch_sql_to_polars")
+ def test_get_df_polars(self, mock_reader):
+ mock_reader.return_value = "df"
+
+ self.conn.es = MagicMock()
+
+ result = self.db_hook.get_df("SELECT 1", df_type="polars")
+
+ assert result == "df"
Review Comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]