Skip to content

Conversation

@hussein-awala
Copy link
Member

closes: #30557


In this PR I fix the UI fields name by removing the custom prefix from Azure conn extra fields, deprecating the used fields with this prefix in order to remove them in the future, clean the documentation, and clean the provider tests.

@eladkal
Copy link
Contributor

eladkal commented Apr 10, 2023

We also have entry for Azure in #28790

@hussein-awala hussein-awala marked this pull request as ready for review April 14, 2023 00:39
@hussein-awala
Copy link
Member Author

The method _ensure_prefixes was added in #27041 by @dstandish:

def _ensure_prefixes(conn_type):
"""
Remove when provider min airflow version >= 2.5.0 since this is handled by
provider manager from that version.
"""

I don't think we really need to wait until bumping the provider min airflow version to >= 2.5.0, since we check for the two variables (with and without extra_...) in each extra field loading, and with this PR, we will have:

  • For the new connections, the extra fields will be created without extra_ prefix -> this should work without any problem
  • For the connection which have fields with extra_, when we update them will have a new field without the extra_ prefix and another one with extra_ prefix but with the old value, this old value will not be processed as long as the new one is present in the extra.
  • For the connection which have fields with extra_, without any update, the provider will use the fields with the prefix, and a warning will be logged to prompt the user to update the connection extra fields.

WDYT?

@potiuk
Copy link
Member

potiuk commented Apr 14, 2023

Hmm. I think the problem was that without the "ensure prefixes" providers_manager woudl crash during building the UI fir connections or at least wreak some havoc. I think we would need to build such provder and install it in airflow 2.3 to be sure.

@potiuk
Copy link
Member

potiuk commented Apr 14, 2023

After defining connection with 2.3 of course.

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label May 30, 2023
@hussein-awala hussein-awala removed the stale Stale PRs per the .github/workflows/stale.yml policy file label May 30, 2023
@github-actions
Copy link

github-actions bot commented Aug 3, 2023

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Aug 3, 2023
@github-actions github-actions bot removed the stale Stale PRs per the .github/workflows/stale.yml policy file label Aug 5, 2023
@hussein-awala hussein-awala changed the title [WIP] Clean microsoft azure provider by deleting the custom prefix from conn extra fields Clean microsoft azure provider by deleting the custom prefix from conn extra fields Aug 7, 2023
@hussein-awala
Copy link
Member Author

@potiuk I tested this PR with 2.4.0 (the current min version) and with main, I can create connections with and without the extra__azure__ prefix without any issue. What kind of tests should I do before merging it?
And for this commet:

Hmm. I think the problem was that without the "ensure prefixes" providers_manager woudl crash during building the UI fir connections or at least wreak some havoc. I think we would need to build such provder and install it in airflow 2.3 to be sure.

There is no problems with the UI:
image
image
image
(6.2.3 because I built it with breeze and installed it from source in a clean conda env)

@potiuk
Copy link
Member

potiuk commented Aug 7, 2023

I can't remember exactly (the comment was from more than 3 months ago) but I believe it was based on "providers back-compat tests" failing back then. We moved to 2.4 min version since, so I think this is good to go now - maybe because of back-compat problem going away because of the min-airflow version bump :)

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.

Azure connections extra fields are inconsistent between the doc, tests and the UI connections

3 participants