Provide default for EXCLUDED_PROVIDERS lookup.#43385
Merged
potiuk merged 1 commit intoOct 25, 2024
Merged
Conversation
The current code throws a KeyError when the environment variable EXCLUDED_PROVIDERS is not defind. This commit adds an empty map as a default to prevent this failure.
Contributor
Author
|
I don't recall requesting a review (although it seems reasonable). Is that an automated GitHub action? If so, it shouldn't show up as being from me! |
potiuk
approved these changes
Oct 25, 2024
Member
It is how CODEOWNERS work |
Contributor
Author
|
Oh, okay. I didn't know about CODEOWNERS! Thank you. |
ellisms
pushed a commit
to ellisms/airflow
that referenced
this pull request
Nov 13, 2024
The current code throws a KeyError when the environment variable EXCLUDED_PROVIDERS is not defind. This commit adds an empty map as a default to prevent this failure.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The current code throws a KeyError when the environment variable EXCLUDED_PROVIDERS is not defined. This commit adds an empty map as a default to prevent this failure.
This was discovered while trying to replicate the issue with microsoft-kiota-http logged here:
microsoftgraph/msgraph-sdk-python-core#706
Before:
Forcing dependencies to lowest versions for provider: [microsoft-azure]
Traceback (most recent call last):
File "/opt/airflow/scripts/in_container/is_provider_excluded.py", line 26, in
excluded_providers = json.loads(os.environ["EXCLUDED_PROVIDERS"])
File "/usr/local/lib/python3.9/os.py", line 679, in getitem
raise KeyError(key) from None
KeyError: 'EXCLUDED_PROVIDERS'
After:
Forcing dependencies to lowest versions for provider: [microsoft-azure]
Check if provider is excluded in {}
Provider is not excluded.