Skip to content

Make sure that only valid elasticsearch keys are passed to handler#34119

Merged
potiuk merged 1 commit into
apache:mainfrom
potiuk:fix-elasticsearch-providers-pre-2-7-1
Sep 7, 2023
Merged

Make sure that only valid elasticsearch keys are passed to handler#34119
potiuk merged 1 commit into
apache:mainfrom
potiuk:fix-elasticsearch-providers-pre-2-7-1

Conversation

@potiuk

@potiuk potiuk commented Sep 5, 2023

Copy link
Copy Markdown
Member

The elasticsearch handler got all configuraiton parameters from the "elasticsearch_config" section but it means that in airflow versions pre 2.7 it could get old config keys which renders the new provider unusable.

This PR filters out configuration parameter to only pass valid parameters for the new handler.

Fixes: #34099


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

Comment thread airflow/providers/elasticsearch/log/es_task_handler.py Outdated
@potiuk
potiuk force-pushed the fix-elasticsearch-providers-pre-2-7-1 branch 5 times, most recently from 6c37f5a to 3e32fea Compare September 5, 2023 20:59
Comment thread airflow/providers/elasticsearch/log/es_task_handler.py Outdated

@pankajkoti pankajkoti left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the PR on the ES remote logging with the installed stack on my end. Works fine.

@potiuk
potiuk force-pushed the fix-elasticsearch-providers-pre-2-7-1 branch 2 times, most recently from 48773c0 to 2183283 Compare September 6, 2023 21:51
@potiuk

potiuk commented Sep 6, 2023

Copy link
Copy Markdown
Member Author

All things addressed @Taragolis I think. Good eye for details!

The elasticsearch handler got all configuraiton parameters
from the "elasticsearch_config" section but it means that in
airflow versions pre 2.7 it could get old config keys which renders
the new provider unusable.

This PR filters out configuration parameter to only pass valid
parameters for the new handler.

Fixes: apache#34099
@potiuk
potiuk force-pushed the fix-elasticsearch-providers-pre-2-7-1 branch from 2183283 to 23d1da9 Compare September 6, 2023 21:56

@Taragolis Taragolis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@potiuk
potiuk merged commit f7f3b67 into apache:main Sep 7, 2023
@potiuk
potiuk deleted the fix-elasticsearch-providers-pre-2-7-1 branch September 7, 2023 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Elasticsearch.__init__() got an unexpected keyword argument 'use_ssl'

3 participants