Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
Update workflows (#3858)
Openverse (Bot)331b576ad8dd
diff --git a/.github/workflows/pr_label_check.yml b/.github/workflows/pr_label_check.ymlindex abcee295f..ec07a9d73 100644--- a/.github/workflows/pr_label_check.yml+++ b/.github/workflows/pr_label_check.yml@@ -42,7 +42,7 @@ jobs:- get_label_groupssteps:- name: Check aspect label- uses: docker://agilepathway/pull-request-label-checker:v1.6.20+ uses: docker://agilepathway/pull-request-label-checker:v1.6.23with:any_of: ${{ needs.get_label_groups.outputs.aspect }}repo_token: ${{ secrets.GITHUB_TOKEN }}@@ -55,7 +55,7 @@ jobs:- get_label_groupssteps:- name: Check goal label- uses: docker://agilepathway/pull-request-label-checker:v1.6.20+ uses: docker://agilepathway/pull-request-label-checker:v1.6.23with:one_of: ${{ needs.get_label_groups.outputs.goal }}repo_token: ${{ secrets.GITHUB_TOKEN }}@@ -68,7 +68,7 @@ jobs:- get_label_groupssteps:- name: Check priority label- uses: docker://agilepathway/pull-request-label-checker:v1.6.20+ uses: docker://agilepathway/pull-request-label-checker:v1.6.23with:one_of: ${{ needs.get_label_groups.outputs.priority }}repo_token: ${{ secrets.GITHUB_TOKEN }}@@ -81,7 +81,7 @@ jobs:- get_label_groupssteps:- name: Check stack label- uses: docker://agilepathway/pull-request-label-checker:v1.6.20+ uses: docker://agilepathway/pull-request-label-checker:v1.6.23with:any_of: ${{ needs.get_label_groups.outputs.stack }}repo_token: ${{ secrets.GITHUB_TOKEN }}diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yamlindex dc6a456f9..81b2c97da 100644--- a/.pre-commit-config.yaml+++ b/.pre-commit-config.yaml@@ -46,7 +46,7 @@ repos:- id: requirements-txt-fixer- repo: https://github.com/astral-sh/ruff-pre-commit- rev: v0.2.0+ rev: v0.3.0hooks:- id: ruff # replaces Flake8, isort, pydocstyle, pyupgradeargs:@@ -74,7 +74,7 @@ repos:- id: shfmt-docker- repo: https://github.com/rhysd/actionlint- rev: v1.6.26+ rev: v1.6.27hooks:- id: actionlint-docker@@ -153,7 +153,7 @@ repos:files: (.vale/.*|.mdx?)$- repo: https://github.com/renovatebot/pre-commit-hooks- rev: 37.168.1+ rev: 37.221.1hooks:- id: renovate-config-validatorargs:diff --git a/api/api/constants/media_types.py b/api/api/constants/media_types.pyindex ae97bbd3e..a1b0f71f4 100644--- a/api/api/constants/media_types.py+++ b/api/api/constants/media_types.py@@ -1,4 +1,5 @@"""Also see `ingestion_server/constants/media_types.py`."""+from typing import Literaldiff --git a/api/api/utils/aiohttp.py b/api/api/utils/aiohttp.pyindex 2d1905a36..339f9db0b 100644--- a/api/api/utils/aiohttp.py+++ b/api/api/utils/aiohttp.py@@ -14,9 +14,9 @@ _SESSIONS: weakref.WeakKeyDictionary[asyncio.AbstractEventLoop, aiohttp.ClientSession] = weakref.WeakKeyDictionary()-_LOCKS: weakref.WeakKeyDictionary[- asyncio.AbstractEventLoop, asyncio.Lock-] = weakref.WeakKeyDictionary()+_LOCKS: weakref.WeakKeyDictionary[asyncio.AbstractEventLoop, asyncio.Lock] = (+ weakref.WeakKeyDictionary()+)@asgi_shutdown.connectdiff --git a/api/api/utils/licenses.py b/api/api/utils/licenses.pyindex 4a58a9e93..01ae9337f 100644--- a/api/api/utils/licenses.py+++ b/api/api/utils/licenses.py@@ -5,7 +5,6 @@ For any changes made here, please make the corresponding changes in thefrontend, or open an issue to track it."""-from api.constants.licenses import (ALL_CC_LICENSES,DEPRECATED_CC_LICENSES,diff --git a/api/conf/urls/__init__.py b/api/conf/urls/__init__.pyindex 62a980aa2..8ce45a6ad 100644--- a/api/conf/urls/__init__.py+++ b/api/conf/urls/__init__.py@@ -4,6 +4,7 @@ URL configuration for the Openverse API.For more information on this file, seehttps://docs.djangoproject.com/en/4.2/topics/http/urls/"""+from django.conf import settingsfrom django.conf.urls.static import staticfrom django.contrib import admindiff --git a/api/test/fixtures/asynchronous.py b/api/test/fixtures/asynchronous.pyindex 5277a134a..e0041bf5c 100644--- a/api/test/fixtures/asynchronous.py+++ b/api/test/fixtures/asynchronous.py@@ -43,8 +43,7 @@ def ensure_asgi_lifecycle(session_loop: asyncio.AbstractEventLoop):"""scope = {"type": "lifespan"}- async def noop(*args, **kwargs):- ...+ async def noop(*args, **kwargs): ...async def shutdown():return {"type": "lifespan.shutdown"}diff --git a/api/test/unit/utils/test_throttle.py b/api/test/unit/utils/test_throttle.pyindex a727ea2b8..975276c38 100644--- a/api/test/unit/utils/test_throttle.py+++ b/api/test/unit/utils/test_throttle.py@@ -43,9 +43,9 @@ def enable_throttles(settings):# Put settings into base Django settings from which DRF reads# settings when we call `api_settings.reload()`settings.REST_FRAMEWORK["DEFAULT_THROTTLE_RATES"] = settings.DEFAULT_THROTTLE_RATES- settings.REST_FRAMEWORK[- "DEFAULT_THROTTLE_CLASSES"- ] = settings.DEFAULT_THROTTLE_CLASSES+ settings.REST_FRAMEWORK["DEFAULT_THROTTLE_CLASSES"] = (+ settings.DEFAULT_THROTTLE_CLASSES+ )# Reload the settings and read them from base Django settings# Also handles importing classes from class strings, etcdiff --git a/automations/python/models/label.py b/automations/python/models/label.pyindex edbed65a4..6a91967e7 100644--- a/automations/python/models/label.py+++ b/automations/python/models/label.py@@ -4,7 +4,6 @@ from models.label_group import LabelGroupclass Label:-"""Represents a single label.diff --git a/automations/python/workflows/get_folder_differences.py b/automations/python/workflows/get_folder_differences.pyindex a45053fa1..cbf2572b5 100644--- a/automations/python/workflows/get_folder_differences.py+++ b/automations/python/workflows/get_folder_differences.py@@ -7,6 +7,7 @@ changed. It then converts the paths to URLs that can be used to view thefiles on the docs preview site. Finally, it outputs the preview site docsgenerated comment along with a list of new and changed files."""+import osimport shutilimport subprocessdiff --git a/catalog/dags/common/cloudwatch.py b/catalog/dags/common/cloudwatch.pyindex 0be3df340..3d51b3b57 100644--- a/catalog/dags/common/cloudwatch.py+++ b/catalog/dags/common/cloudwatch.py@@ -9,6 +9,7 @@ Modifying alarms can be skipped by setting the `TOGGLE_CLOUDWATCH_ALARMS` to `Fain the Airflow Variables, which is particularly the desired behavior when runningthe Data Refresh DAGs locally or in a development environment."""+import loggingfrom airflow.exceptions import AirflowSkipExceptiondiff --git a/catalog/dags/common/licenses/licenses.py b/catalog/dags/common/licenses/licenses.pyindex a939de24d..198b78254 100644--- a/catalog/dags/common/licenses/licenses.py+++ b/catalog/dags/common/licenses/licenses.py@@ -2,6 +2,7 @@This module has a number of public methods which are useful for workingwith licenses."""+import loggingfrom functools import lru_cachefrom typing import NamedTuplediff --git a/catalog/dags/common/loader/provider_details.py b/catalog/dags/common/loader/provider_details.pyindex 6e892a62e..39c97daec 100644--- a/catalog/dags/common/loader/provider_details.py+++ b/catalog/dags/common/loader/provider_details.py@@ -8,6 +8,7 @@ Apart from that, this file stores other provider related information whichmight be useful for retrieving sub-providers at the database level and theAPI level."""+import osdiff --git a/catalog/dags/common/storage/db_columns.py b/catalog/dags/common/storage/db_columns.pyindex 2ca7d800e..c508603bf 100644--- a/catalog/dags/common/storage/db_columns.py+++ b/catalog/dags/common/storage/db_columns.py@@ -2,6 +2,7 @@This module contains the lists of database columns in the same order as in themain media tables within the database."""+from common.constants import AUDIO, IMAGEfrom common.storage import columns as colfrom common.utils import setup_kwargs_for_media_typediff --git a/catalog/dags/common/storage/util.py b/catalog/dags/common/storage/util.pyindex 3f6b75f22..514e4e47a 100644--- a/catalog/dags/common/storage/util.py+++ b/catalog/dags/common/storage/util.py@@ -1,4 +1,5 @@"""This module has public methods which are useful for storage operations."""+import loggingfrom common.storage.audio import AudioStorediff --git a/catalog/dags/common/urls.py b/catalog/dags/common/urls.pyindex d8dd08f16..cdfc33e3e 100644--- a/catalog/dags/common/urls.py+++ b/catalog/dags/common/urls.py@@ -2,6 +2,7 @@This module has a number of public methods which are useful forverifying and cleaning URLs."""+import loggingimport refrom functools import lru_cachediff --git a/catalog/dags/data_refresh/create_filtered_index.py b/catalog/dags/data_refresh/create_filtered_index.pyindex f4fd3d927..a77c2d53e 100644--- a/catalog/dags/data_refresh/create_filtered_index.py+++ b/catalog/dags/data_refresh/create_filtered_index.py@@ -15,6 +15,7 @@ index, and then points the filtered index alias for the media type to the new infinally deleting the old, now unused filtered index. These TaskGroups are used inthe data refresh DAGs to execute the filtered index steps."""+from datetime import timedeltafrom airflow.operators.empty import EmptyOperatordiff --git a/catalog/dags/data_refresh/create_filtered_index_dag.py b/catalog/dags/data_refresh/create_filtered_index_dag.pyindex 7fc0f38ea..20f365f98 100644--- a/catalog/dags/data_refresh/create_filtered_index_dag.py+++ b/catalog/dags/data_refresh/create_filtered_index_dag.py@@ -50,6 +50,7 @@ DAG runs for the media type to finish before continuing.This ensures that neither are depending on or modifying the origin indexescritical for the creation of the filtered indexes."""+from datetime import datetimefrom airflow import DAGdiff --git a/catalog/dags/data_refresh/dag_factory.py b/catalog/dags/data_refresh/dag_factory.pyindex 838ab97c8..358a0b3e2 100644--- a/catalog/dags/data_refresh/dag_factory.py+++ b/catalog/dags/data_refresh/dag_factory.py@@ -22,6 +22,7 @@ https://github.com/WordPress/openverse-catalog/issues/353)- [[Feature] Merge popularity calculations and data refresh into a single DAG](https://github.com/WordPress/openverse-catalog/issues/453)"""+import loggingfrom collections.abc import Sequencediff --git a/catalog/dags/data_refresh/data_refresh_task_factory.py b/catalog/dags/data_refresh/data_refresh_task_factory.pyindex 8444f0641..3ad20a806 100644--- a/catalog/dags/data_refresh/data_refresh_task_factory.py+++ b/catalog/dags/data_refresh/data_refresh_task_factory.py@@ -44,6 +44,7 @@ issues and related PRs:- [[Feature] Data refresh orchestration DAG](https://github.com/WordPress/openverse-catalog/issues/353)"""+import loggingimport osfrom collections.abc import Sequencediff --git a/catalog/dags/data_refresh/data_refresh_types.py b/catalog/dags/data_refresh/data_refresh_types.pyindex f6bc6dff6..27d2cc0ca 100644--- a/catalog/dags/data_refresh/data_refresh_types.py+++ b/catalog/dags/data_refresh/data_refresh_types.py@@ -5,6 +5,7 @@ configuration for a Data Refresh DAG, and defines the actual `DATA_REFRESH_CONFIfor each of our media types. This configuration information is used to generatethe dynamic Data Refresh dags."""+import osfrom dataclasses import dataclass, fieldfrom datetime import datetime, timedeltadiff --git a/catalog/dags/database/batched_update/batched_update_dag.py b/catalog/dags/database/batched_update/batched_update_dag.pyindex a698d79eb..c032e027e 100644--- a/catalog/dags/database/batched_update/batched_update_dag.py+++ b/catalog/dags/database/batched_update/batched_update_dag.py@@ -63,7 +63,6 @@ for example, if there was a problem with the `update_query` which caused DAGfailures during the `update_batches` step."""-import loggingfrom airflow.decorators import dagdiff --git a/catalog/dags/database/delete_records/delete_records_dag.py b/catalog/dags/database/delete_records/delete_records_dag.pyindex 679de59be..62a922074 100644--- a/catalog/dags/database/delete_records/delete_records_dag.py+++ b/catalog/dags/database/delete_records/delete_records_dag.py@@ -50,7 +50,6 @@ DAG, for instance. The simplest way to do this is to ensure that any affected prDAGs are not currently running."""-import loggingfrom airflow.decorators import dagdiff --git a/catalog/dags/database/report_pending_reported_media.py b/catalog/dags/database/report_pending_reported_media.pyindex 61f041691..edc1e850e 100644--- a/catalog/dags/database/report_pending_reported_media.py+++ b/catalog/dags/database/report_pending_reported_media.py@@ -9,6 +9,7 @@ determine whether further action (such as deindexing the record) needs to betaken. If a record has been reported multiple times, it only needs to bereviewed once and so is only counted once in the reporting by this DAG."""+import loggingimport osfrom textwrap import dedentdiff --git a/catalog/dags/elasticsearch_cluster/create_new_es_index/create_new_es_index_dag.py b/catalog/dags/elasticsearch_cluster/create_new_es_index/create_new_es_index_dag.pyindex 3062281ee..407af9a5f 100644--- a/catalog/dags/elasticsearch_cluster/create_new_es_index/create_new_es_index_dag.py+++ b/catalog/dags/elasticsearch_cluster/create_new_es_index/create_new_es_index_dag.py@@ -96,6 +96,7 @@ The resulting, merged configuration will be:}```"""+import loggingfrom airflow import DAGdiff --git a/catalog/dags/elasticsearch_cluster/create_proportional_by_source_staging_index/create_proportional_by_source_staging_index_dag.py b/catalog/dags/elasticsearch_cluster/create_proportional_by_source_staging_index/create_proportional_by_source_staging_index_dag.pyindex 28ed4a02a..1903d5f0c 100644--- a/catalog/dags/elasticsearch_cluster/create_proportional_by_source_staging_index/create_proportional_by_source_staging_index_dag.py+++ b/catalog/dags/elasticsearch_cluster/create_proportional_by_source_staging_index/create_proportional_by_source_staging_index_dag.py@@ -36,6 +36,7 @@ immediately if any of the following DAGs are running:* `recreate_full_staging_index`* `create_new_staging_es_index`"""+from datetime import datetime, timedeltafrom airflow.decorators import dagdiff --git a/catalog/dags/elasticsearch_cluster/recreate_staging_index/recreate_full_staging_index_dag.py b/catalog/dags/elasticsearch_cluster/recreate_staging_index/recreate_full_staging_index_dag.pyindex b91e93edb..0be1bc848 100644--- a/catalog/dags/elasticsearch_cluster/recreate_staging_index/recreate_full_staging_index_dag.py+++ b/catalog/dags/elasticsearch_cluster/recreate_staging_index/recreate_full_staging_index_dag.py@@ -40,6 +40,7 @@ immediately if any of the following DAGs are running:* `create_proportional_by_provider_staging_index`* `create_new_staging_es_index`"""+from datetime import datetimefrom airflow.decorators import dagdiff --git a/catalog/dags/flickr_thumbs_removal.py b/catalog/dags/flickr_thumbs_removal.pyindex 5c8615c2e..9c2e9e0eb 100644--- a/catalog/dags/flickr_thumbs_removal.py+++ b/catalog/dags/flickr_thumbs_removal.py@@ -2,6 +2,7 @@One-time run DAG to remove progressively all the old Flickr thumbnails,as they were determined to be unsuitable for the Openverse UI requirements."""+import loggingfrom datetime import timedeltafrom textwrap import dedentdiff --git a/catalog/dags/maintenance/add_license_url.py b/catalog/dags/maintenance/add_license_url.pyindex 61a03012b..3eb36de35 100644--- a/catalog/dags/maintenance/add_license_url.py+++ b/catalog/dags/maintenance/add_license_url.py@@ -9,6 +9,7 @@ This is a maintenance DAG that should be run once. If all the null values inthe `meta_data` column are updated, the DAG will only run the first and thelast step, logging the statistics."""+import csvimport loggingfrom collections import defaultdictdiff --git a/catalog/dags/maintenance/airflow_log_cleanup_workflow.py b/catalog/dags/maintenance/airflow_log_cleanup_workflow.pyindex 23f2876d6..e645ab6a8 100644--- a/catalog/dags/maintenance/airflow_log_cleanup_workflow.py+++ b/catalog/dags/maintenance/airflow_log_cleanup_workflow.py@@ -19,6 +19,7 @@ airflow dags trigger --conf- maxLogAgeInDays:<INT> - Optional- enableDelete:<BOOLEAN> - Optional"""+from datetime import datetime, timedeltaimport jinja2diff --git a/catalog/dags/oauth2/authorize_dag.py b/catalog/dags/oauth2/authorize_dag.pyindex a02238ed9..db5ad0c48 100644--- a/catalog/dags/oauth2/authorize_dag.py+++ b/catalog/dags/oauth2/authorize_dag.py@@ -1,4 +1,5 @@"""# OAuth Provider Authorization"""+from datetime import datetimefrom airflow.models import DAGdiff --git a/catalog/dags/oauth2/token_refresh_dag.py b/catalog/dags/oauth2/token_refresh_dag.pyindex 56c65309a..4c83fdef6 100644--- a/catalog/dags/oauth2/token_refresh_dag.py+++ b/catalog/dags/oauth2/token_refresh_dag.py@@ -1,4 +1,5 @@"""# OAuth Provider Token Refresh"""+from datetime import datetimefrom airflow.models import DAGdiff --git a/catalog/dags/popularity/popularity_refresh_dag_factory.py b/catalog/dags/popularity/popularity_refresh_dag_factory.pyindex d8f05b433..615d7fc50 100644--- a/catalog/dags/popularity/popularity_refresh_dag_factory.py+++ b/catalog/dags/popularity/popularity_refresh_dag_factory.py@@ -22,6 +22,7 @@ implementation plan:- [[Implementation Plan] Decoupling Popularity Calculations from the Data Refresh](https://docs.openverse.org/projects/proposals/popularity_optimizations/20230420-implementation_plan_popularity_optimizations.html)"""+import loggingfrom datetime import datetimediff --git a/catalog/dags/popularity/popularity_refresh_types.py b/catalog/dags/popularity/popularity_refresh_types.pyindex 67c9cb519..46d661ab5 100644--- a/catalog/dags/popularity/popularity_refresh_types.py+++ b/catalog/dags/popularity/popularity_refresh_types.py@@ -5,6 +5,7 @@ configuration for a Popularity Refresh DAG, and defines the actual`POPULARITY_REFRESH_CONFIGS` for each of our media types. This configuration infois used to generate the dynamic Popularity Refresh dags."""+import osfrom dataclasses import dataclass, fieldfrom datetime import datetime, timedeltadiff --git a/catalog/dags/popularity/recreate_popularity_calculation_dag_factory.py b/catalog/dags/popularity/recreate_popularity_calculation_dag_factory.pyindex f8662b06b..c13ea77eb 100644--- a/catalog/dags/popularity/recreate_popularity_calculation_dag_factory.py+++ b/catalog/dags/popularity/recreate_popularity_calculation_dag_factory.py@@ -12,6 +12,7 @@ the new functions.These DAGs are not on a schedule, and should only be run manually when newSQL code is deployed for the calculation."""+from airflow import DAGfrom common.constants import DAG_DEFAULT_ARGS, POSTGRES_CONN_ID@@ -74,6 +75,6 @@ for popularity_refresh in POPULARITY_REFRESH_CONFIGS:recreate_popularity_calculation_dag = create_recreate_popularity_calculation_dag(popularity_refresh)- globals()[- recreate_popularity_calculation_dag.dag_id- ] = recreate_popularity_calculation_dag+ globals()[recreate_popularity_calculation_dag.dag_id] = (+ recreate_popularity_calculation_dag+ )diff --git a/catalog/dags/providers/provider_api_scripts/auckland_museum.py b/catalog/dags/providers/provider_api_scripts/auckland_museum.pyindex 87035537a..2d57da0fc 100644--- a/catalog/dags/providers/provider_api_scripts/auckland_museum.py+++ b/catalog/dags/providers/provider_api_scripts/auckland_museum.py@@ -16,6 +16,7 @@ Resource | Requests per second | Requests per day/search, /id | 10 | 1000/id/media | 10 | 1000"""+import loggingfrom datetime import datetime, timedeltadiff --git a/catalog/dags/providers/provider_api_scripts/europeana.py b/catalog/dags/providers/provider_api_scripts/europeana.pyindex 8a4ea6876..63f44685d 100644--- a/catalog/dags/providers/provider_api_scripts/europeana.py+++ b/catalog/dags/providers/provider_api_scripts/europeana.py@@ -8,6 +8,7 @@ Output: TSV file containing the images and theNotes: https://pro.europeana.eu/page/search"""+import argparseimport functoolsimport loggingdiff --git a/catalog/dags/providers/provider_api_scripts/finnish_museums.py b/catalog/dags/providers/provider_api_scripts/finnish_museums.pyindex de842b37e..28ec13147 100644--- a/catalog/dags/providers/provider_api_scripts/finnish_museums.py+++ b/catalog/dags/providers/provider_api_scripts/finnish_museums.py@@ -14,6 +14,7 @@ Notes: https://api.finna.fi/swagger-ui/reingestion DAG, as updated data will be processed duringregular ingestion."""+import loggingfrom itertools import chaindiff --git a/catalog/dags/providers/provider_api_scripts/freesound.py b/catalog/dags/providers/provider_api_scripts/freesound.pyindex 6cf55bc80..fc6f01a7f 100644--- a/catalog/dags/providers/provider_api_scripts/freesound.py+++ b/catalog/dags/providers/provider_api_scripts/freesound.py@@ -11,6 +11,7 @@ Notes: https://freesound.org/docs/api/This script can be run either to ingest the full dataset oras a dated DAG."""+import functoolsimport loggingfrom datetime import datetimediff --git a/catalog/dags/providers/provider_api_scripts/jamendo.py b/catalog/dags/providers/provider_api_scripts/jamendo.pyindex 5243bf958..0b58c1f94 100644--- a/catalog/dags/providers/provider_api_scripts/jamendo.py+++ b/catalog/dags/providers/provider_api_scripts/jamendo.py@@ -15,6 +15,7 @@ Notes: https://api.jamendo.com/v3.0/tracks/sample rate: 44.1 or 48 kHzchannels: 1/2"""+import loggingfrom datetime import timedeltafrom urllib.parse import parse_qs, urlencode, urlsplitdiff --git a/catalog/dags/providers/provider_api_scripts/justtakeitfree.py b/catalog/dags/providers/provider_api_scripts/justtakeitfree.pyindex 7b0bafbea..503b8c8ed 100644--- a/catalog/dags/providers/provider_api_scripts/justtakeitfree.py+++ b/catalog/dags/providers/provider_api_scripts/justtakeitfree.py@@ -9,6 +9,7 @@ Output: TSV file containing the media and theNotes: https://justtakeitfree.com/api/api.phpThis API requires an API key. For more details, see https://github.com/WordPress/openverse/pull/2793"""+import loggingfrom airflow.models import Variablediff --git a/catalog/dags/providers/provider_api_scripts/nappy.py b/catalog/dags/providers/provider_api_scripts/nappy.pyindex f9078b8ba..ffe9d6eb9 100644--- a/catalog/dags/providers/provider_api_scripts/nappy.py+++ b/catalog/dags/providers/provider_api_scripts/nappy.py@@ -10,6 +10,7 @@ Notes: This api was written specially for Openverse.https://nappy.co/"""+import loggingfrom common import constantsdiff --git a/catalog/dags/providers/provider_api_scripts/rawpixel.py b/catalog/dags/providers/provider_api_scripts/rawpixel.pyindex bbd8d6570..dbe68df03 100644--- a/catalog/dags/providers/provider_api_scripts/rawpixel.py+++ b/catalog/dags/providers/provider_api_scripts/rawpixel.py@@ -12,6 +12,7 @@ Notes: Rawpixel has given Openverse beta access to their API.although the API key we've been given can circumvent this limit.https://www.rawpixel.com/api/v1/search?tags=$publicdomain&page=1&pagesize=100"""+import base64import hmacimport htmldiff --git a/catalog/dags/providers/provider_api_scripts/science_museum.py b/catalog/dags/providers/provider_api_scripts/science_museum.pyindex 35a8ff513..7876ecf4b 100644--- a/catalog/dags/providers/provider_api_scripts/science_museum.py+++ b/catalog/dags/providers/provider_api_scripts/science_museum.py@@ -9,6 +9,7 @@ Output: TSV file containing the image, the respectiveNotes: https://github.com/TheScienceMuseum/collectionsonline/wiki/Collections-Online-APIRate limited, no specific rate given.""" # noqa: E501+import loggingimport refrom datetime import datediff --git a/catalog/dags/providers/provider_api_scripts/smk.py b/catalog/dags/providers/provider_api_scripts/smk.pyindex 63d0ff660..b17d1142e 100644--- a/catalog/dags/providers/provider_api_scripts/smk.py+++ b/catalog/dags/providers/provider_api_scripts/smk.py@@ -7,6 +7,7 @@ Output: TSV file containing the media metadata.Notes: https://www.smk.dk/en/article/smk-api/"""+import loggingimport urllib.parsediff --git a/catalog/dags/providers/provider_api_scripts/stocksnap.py b/catalog/dags/providers/provider_api_scripts/stocksnap.pyindex e7d2f558d..faca731e3 100644--- a/catalog/dags/providers/provider_api_scripts/stocksnap.py+++ b/catalog/dags/providers/provider_api_scripts/stocksnap.py@@ -11,6 +11,7 @@ Notes: https://stocksnap.io/api/load-photos/date/desc/1No rate limits or authorization required.API is undocumented."""+import jsonimport loggingdiff --git a/catalog/dags/providers/provider_api_scripts/wordpress.py b/catalog/dags/providers/provider_api_scripts/wordpress.pyindex 4d8fc3dfb..4c60d1b46 100644--- a/catalog/dags/providers/provider_api_scripts/wordpress.py+++ b/catalog/dags/providers/provider_api_scripts/wordpress.py@@ -9,6 +9,7 @@ Notes: https://wordpress.org/photos/wp-json/wp/v2Provide photos, media, users and more related resources.No rate limit specified."""+import loggingimport lxml.html as htmldiff --git a/catalog/dags/providers/provider_dag_factory.py b/catalog/dags/providers/provider_dag_factory.pyindex dc31be489..a35159866 100644--- a/catalog/dags/providers/provider_dag_factory.py+++ b/catalog/dags/providers/provider_dag_factory.py@@ -62,6 +62,7 @@ https://github.com/creativecommons/cccatalog/issues/333)- [DB Loader should take data from S3, rather than EC2 to load into PostgreSQL](https://github.com/creativecommons/cccatalog/issues/334)"""+import loggingimport osimport rediff --git a/catalog/tests/dags/common/storage/test_media.py b/catalog/tests/dags/common/storage/test_media.pyindex e84332616..d1cdfd9d3 100644--- a/catalog/tests/dags/common/storage/test_media.py+++ b/catalog/tests/dags/common/storage/test_media.py@@ -2,6 +2,7 @@MediaStore is an abstract class, so to test it weuse one of the inheriting classes, ImageStore"""+import loggingfrom unittest.mock import patchdiff --git a/catalog/tests/dags/common/test_resources/fake_provider_module.py b/catalog/tests/dags/common/test_resources/fake_provider_module.pyindex 811ca852e..196b7cd1f 100644--- a/catalog/tests/dags/common/test_resources/fake_provider_module.py+++ b/catalog/tests/dags/common/test_resources/fake_provider_module.py@@ -2,6 +2,7 @@This is a fake provider module used in test_dag_factory.It is used to check that the output path acquisition logic is correct."""+from common.storage.audio import AudioStorefrom common.storage.image import ImageStorediff --git a/catalog/tests/dags/maintenance/test_pr_review_reminders.py b/catalog/tests/dags/maintenance/test_pr_review_reminders.pyindex 9d2ad8634..07731e5a7 100644--- a/catalog/tests/dags/maintenance/test_pr_review_reminders.py+++ b/catalog/tests/dags/maintenance/test_pr_review_reminders.py@@ -265,9 +265,9 @@ def test_pings_past_due(github, urgency, events):github["events"][past_due_pull["number"]] = make_urgent_events(urgency, events)github["events"][not_due_pull["number"]] = make_non_urgent_events(events)- github["events"][- old_but_not_due_pull["number"]- ] = make_non_urgent_reviewable_events(events)+ github["events"][old_but_not_due_pull["number"]] = (+ make_non_urgent_reviewable_events(events)+ )post_reminders("not_set", dry_run=False)@@ -307,9 +307,9 @@ def test_does_not_reping_past_due_if_reminder_is_current(github, urgency, eventsgithub["events"][past_due_pull["number"]] = make_urgent_events(urgency, events)github["events"][not_due_pull["number"]] = make_non_urgent_events(events)- github["events"][- old_but_not_due_pull["number"]- ] = make_non_urgent_reviewable_events(events)+ github["events"][old_but_not_due_pull["number"]] = (+ make_non_urgent_reviewable_events(events)+ )post_reminders("not_set", dry_run=False)@@ -343,9 +343,9 @@ def test_does_reping_past_due_if_reminder_is_outdated(github, urgency, events):github["events"][past_due_pull["number"]] = make_urgent_events(urgency, events)github["events"][not_due_pull["number"]] = make_non_urgent_events(events)- github["events"][- old_but_not_due_pull["number"]- ] = make_non_urgent_reviewable_events(events)+ github["events"][old_but_not_due_pull["number"]] = (+ make_non_urgent_reviewable_events(events)+ )post_reminders("not_set", dry_run=False)@@ -459,9 +459,9 @@ def test_does_not_ping_if_no_reviewers(github, urgency, events):github["events"][past_due_pull["number"]] = make_urgent_events(urgency, events)github["events"][not_due_pull["number"]] = make_non_urgent_events(events)- github["events"][- old_but_not_due_pull["number"]- ] = make_non_urgent_reviewable_events(events)+ github["events"][old_but_not_due_pull["number"]] = (+ make_non_urgent_reviewable_events(events)+ )for pr in [past_due_pull, not_due_pull]:_setup_branch_protection(github, pr)diff --git a/catalog/tests/dags/providers/provider_api_scripts/resources/inaturalist/pull_sample_records.py b/catalog/tests/dags/providers/provider_api_scripts/resources/inaturalist/pull_sample_records.pyindex ac58de781..5fffe0615 100644--- a/catalog/tests/dags/providers/provider_api_scripts/resources/inaturalist/pull_sample_records.py+++ b/catalog/tests/dags/providers/provider_api_scripts/resources/inaturalist/pull_sample_records.py@@ -7,7 +7,6 @@ Assumes that large files are saved outside of the Openverse repo to take pressurgit and linting."""-import csvimport gzipimport osdiff --git a/catalog/tests/dags/providers/provider_api_scripts/test_wikimedia_commons.py b/catalog/tests/dags/providers/provider_api_scripts/test_wikimedia_commons.pyindex 853e31a72..da446916f 100644--- a/catalog/tests/dags/providers/provider_api_scripts/test_wikimedia_commons.py+++ b/catalog/tests/dags/providers/provider_api_scripts/test_wikimedia_commons.py@@ -493,9 +493,9 @@ def test_get_audio_record_data_parses_wav_invalid_bit_rate(wmc):file_metadata = _get_resource_json("audio_filedata_wav.json")original_data = {"url": "myurl.com", "meta_data": {}}# Set the bit rate higher than the int max- file_metadata["metadata"][5]["value"][3]["value"][0]["value"][3][- "value"- ] = 4294967294+ file_metadata["metadata"][5]["value"][3]["value"][0]["value"][3]["value"] = (+ 4294967294+ )expected_parsed_data = {"url": "myurl.com","bit_rate": None,diff --git a/catalog/utilities/dag_doc_gen/dag_doc_generation.py b/catalog/utilities/dag_doc_gen/dag_doc_generation.pyindex 436bb7096..aabec1dff 100644--- a/catalog/utilities/dag_doc_gen/dag_doc_generation.py+++ b/catalog/utilities/dag_doc_gen/dag_doc_generation.py@@ -13,6 +13,7 @@ individual documentation subsections further in the document.The individual DAG documentation section pulls the DAG's `doc_md` blurb and rendersit within the document."""+import loggingimport refrom collections import defaultdictdiff --git a/documentation/_ext/link_issues.py b/documentation/_ext/link_issues.pyindex cdb70382c..9070b6931 100644--- a/documentation/_ext/link_issues.py+++ b/documentation/_ext/link_issues.py@@ -26,6 +26,7 @@ Changes by Openverse Contributors:Add GitHub token to prevent rate limiting"""+import dataclassesimport osimport rediff --git a/documentation/_ext/link_usernames.py b/documentation/_ext/link_usernames.pyindex 4ed01b89c..d9543b40c 100644--- a/documentation/_ext/link_usernames.py+++ b/documentation/_ext/link_usernames.py@@ -8,6 +8,7 @@ to the user's GitHub profile.The plugin ignores code inside of fixed text blocks, including code blocks and backticks."""+import refrom docutils import nodesdiff --git a/ingestion_server/ingestion_server/api.py b/ingestion_server/ingestion_server/api.pyindex 7285fc695..9156c5613 100644--- a/ingestion_server/ingestion_server/api.py+++ b/ingestion_server/ingestion_server/api.py@@ -1,4 +1,5 @@"""A small RPC API server for scheduling data refresh and indexing tasks."""+import loggingimport osimport timediff --git a/ingestion_server/ingestion_server/cleanup.py b/ingestion_server/ingestion_server/cleanup.pyindex 23f69f843..6e794f290 100644--- a/ingestion_server/ingestion_server/cleanup.py+++ b/ingestion_server/ingestion_server/cleanup.py@@ -3,6 +3,7 @@ Functions for processing data when it is imported into the catalog.This includes cleaning up malformed URLs and filtering out undesirable tags."""+import csvimport logging as logimport multiprocessingdiff --git a/utilities/dead_links/dead_link_tally.py b/utilities/dead_links/dead_link_tally.pyindex 1a1d9cda4..77562a2a5 100644--- a/utilities/dead_links/dead_link_tally.py+++ b/utilities/dead_links/dead_link_tally.py@@ -5,6 +5,7 @@ This script assumes that the API Redis instance you care about is presenton localhost (usually via tunneling). It will run through the link validationentries in Redis."""+import pprintfrom collections import defaultdictfrom urllib.parse import urlparsediff --git a/utilities/project_planning/calculate_average_weeks_of_work.py b/utilities/project_planning/calculate_average_weeks_of_work.pyindex 0b8246de6..94a783b01 100644--- a/utilities/project_planning/calculate_average_weeks_of_work.py+++ b/utilities/project_planning/calculate_average_weeks_of_work.py@@ -4,6 +4,7 @@ members.See the README for more information."""+from pathlib import Pathimport clickdiff --git a/utilities/project_planning/graph_project_voting.py b/utilities/project_planning/graph_project_voting.pyindex df2c79eb9..ee63642d3 100644--- a/utilities/project_planning/graph_project_voting.py+++ b/utilities/project_planning/graph_project_voting.py@@ -3,6 +3,7 @@ Script for generating graphs of project voting results.See the README for more information."""+from datetime import datetimefrom pathlib import Pathdiff --git a/utilities/project_planning/process_selection_votes.py b/utilities/project_planning/process_selection_votes.pyindex b3d3e7073..a809ec4b0 100644--- a/utilities/project_planning/process_selection_votes.py+++ b/utilities/project_planning/process_selection_votes.py@@ -3,6 +3,7 @@ Script for gathering project selection votes and sharing the resultsSee the README for more information."""+from datetime import datetimefrom pathlib import Pathdiff --git a/utilities/provider_tallies/provider_tally_stats.py b/utilities/provider_tallies/provider_tally_stats.pyindex ae073cb97..9f62eff7d 100644--- a/utilities/provider_tallies/provider_tally_stats.py+++ b/utilities/provider_tallies/provider_tally_stats.py@@ -5,6 +5,7 @@ This script assumes that the API Redis instance you care about is presenton localhost (usually via tunneling). It will run through the provider result countentries in Redis and output them to CSV."""+import pprintfrom datetime import datetimefrom pathlib import Path