Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix separator getting added to variables_prefix when empty #26749

Merged
merged 3 commits into from
Sep 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion airflow/providers/microsoft/azure/secrets/key_vault.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,11 @@ def build_path(path_prefix: str, secret_id: str, sep: str = '-') -> str:
:param secret_id: Name of the secret
:param sep: Separator used to concatenate path_prefix and secret_id
"""
path = f'{path_prefix}{sep}{secret_id}'
# When an empty prefix is given, do not add a separator to the secret name
if path_prefix == "":
path = f'{secret_id}'
else:
path = f'{path_prefix}{sep}{secret_id}'
return path.replace('_', sep)

def _get_secret(self, path_prefix: str, secret_id: str) -> str | None:
Expand Down