Skip to content

Comments

Allow and prefer non-prefixed extra fields for slack hooks#27070

Merged
dstandish merged 5 commits intoapache:mainfrom
astronomer:slack-extra-prefix
Oct 22, 2022
Merged

Allow and prefer non-prefixed extra fields for slack hooks#27070
dstandish merged 5 commits intoapache:mainfrom
astronomer:slack-extra-prefix

Conversation

@dstandish
Copy link
Contributor

From airflow version 2.3, extra prefixes are not required so we enable them here.

From airflow version 2.3, extra prefixes are not required so we enable them here.
return wrapper


def _ensure_prefixes(conn_type):
Copy link
Contributor

Choose a reason for hiding this comment

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

I can see this function is a duplicate of the one defined in airflow/providers/slack/hooks/slack.py (and in many other PR you have open). Would not it be better to put it somewhere common once and then use it across the different providers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you are correct. it's not possible because the only thing providers share is airflow, and we can't use features in airflow until they are present in the version specified as dep in provider. the feature that eliminates the need for this decorator will be released in 2.5. when min airflow version for these providers is 2.5, then we can remove this decorator. and if you look at the tests, i actually force this removal at this time! it's tricky managing all the backcompat here but ... that's life!

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. Could you then at least try to have it only once per provider? Here (Slack), you defined this function twice

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oy, sure

@dstandish dstandish merged commit cc44bae into apache:main Oct 22, 2022
@dstandish dstandish deleted the slack-extra-prefix branch October 22, 2022 21:19
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.

4 participants