This repository has been archived by the owner on Aug 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
Remove mutable parameters in provider api scripts #100
Merged
Conversation
This file contains 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
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
To ensure that the tag list is immutable, a set was used. However, order in a set is not guaranteed, so the test fails because the order of extracted tags is incorrect. Set was replaced with tuple that does guarantee the order of elements. Signed-off-by: Olga Bulat <obulat@gmail.com>
Closed
krysal
reviewed
Jun 10, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Splitting the PRs is appreciated. I was thinking it would be good to also add .copy()
when assigning constant dictionaries to prevent mutations completely. What do you think?
src/cc_catalog_airflow/dags/provider_api_scripts/smithsonian.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
krysal
previously approved these changes
Jun 11, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks!
Merged
zackkrida
previously approved these changes
Jun 21, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
# Conflicts: # src/cc_catalog_airflow/dags/provider_api_scripts/brooklyn_museum.py # src/cc_catalog_airflow/dags/provider_api_scripts/museum_victoria.py # src/cc_catalog_airflow/dags/provider_api_scripts/nypl.py # src/cc_catalog_airflow/dags/provider_api_scripts/science_museum.py # src/cc_catalog_airflow/dags/provider_api_scripts/smithsonian.py # src/cc_catalog_airflow/dags/provider_api_scripts/staten_museum.py # src/cc_catalog_airflow/dags/provider_api_scripts/wikimedia_commons.py
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes WordPress/openverse#1732
This PR replaces mutable default parameters in provider api scripts.
This will eliminate one type of possible errors: when the default parameters change between the calls.
I split PR #67 into several PRs to make them more manageable and make reviews easier.
Signed-off-by: Olga Bulat obulat@gmail.com