Codingaditya17 commented on code in PR #67519:
URL: https://github.com/apache/airflow/pull/67519#discussion_r3303971511
##########
providers/elasticsearch/tests/unit/elasticsearch/hooks/test_elasticsearch.py:
##########
@@ -303,7 +303,7 @@ def test_get_df_by_chunks_hook_lineage(self,
mock_get_pandas_df_by_chunks, mock_
assert call_kw["sql"] == sql
assert call_kw["sql_parameters"] == parameters
-
@mock.patch("airflow.providers.elasticsearch.hooks.elasticsearch.Elasticsearch")
+ @mock.patch("elasticsearch.Elasticsearch")
Review Comment:
Because this PR removes `Elasticsearch` from the hook module's global
imports, `airflow.providers.elasticsearch.hooks.elasticsearch.Elasticsearch` no
longer exists as a module-level symbol.
Since the runtime import now happens inside `ESConnection.__init__`, the
test needs to patch the actual import source, `elasticsearch.Elasticsearch`,
instead of patching it through the Airflow hook module.
--
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]