Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
Remove leftover files from catalog (#3915)
Krystle Salazar561739e13a96
diff --git a/catalog/dags/flickr_thumbs_removal.py b/catalog/dags/flickr_thumbs_removal.pydeleted file mode 100644index 9c2e9e0eb..000000000--- a/catalog/dags/flickr_thumbs_removal.py+++ /dev/null@@ -1,81 +0,0 @@-"""-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 logging-from datetime import timedelta-from textwrap import dedent--from airflow.decorators import dag, task--from common.constants import DAG_DEFAULT_ARGS, POSTGRES_CONN_ID-from common.slack import send_message-from common.sql import PostgresHook---logger = logging.getLogger(__name__)---DAG_ID = "flickr_thumbnails_removal"---@dag(- dag_id=DAG_ID,- default_args={- **DAG_DEFAULT_ARGS,- "retries": 0,- "execution_timeout": timedelta(days=7),- },- schedule=None,- catchup=False,- doc_md=__doc__,-)-def flickr_thumbnails_removal():- pg = PostgresHook(postgres_conn_id=POSTGRES_CONN_ID)- select_conditions = "FROM image WHERE provider = 'flickr' AND thumbnail IS NOT NULL"-- @task()- def count():- num_thumbs = pg.get_first(f"SELECT COUNT(*) {select_conditions}")[0]- logger.info(f"Flickr thumbnails found: {num_thumbs}.")-- return num_thumbs-- @task()- def delete(num_thumbs):- log_sql = True- if num_thumbs == 0:- logger.info("No Flickr thumbnails found.")-- while num_thumbs > 0:- query = dedent(- f"""- UPDATE image SET thumbnail = NULL WHERE identifier IN (- SELECT identifier {select_conditions}- FETCH FIRST 10000 ROWS ONLY FOR UPDATE SKIP LOCKED- )- """- )- pg.run(query, log_sql=log_sql)- num_thumbs -= 10000- logger.info(- f"Flickr thumbnails left: {num_thumbs if num_thumbs > 0 else 0}."- )- log_sql = False-- @task()- def report():- msg = (- "All Flickr thumbnails were successfully removed. "- f"The `{DAG_ID}` DAG can be retired."- )- send_message(msg, DAG_ID)-- num_thumbs = count()- d = delete(num_thumbs)- r = report()- d >> r---flickr_thumbnails_removal()diff --git a/catalog/tests/dags/providers/provider_api_scripts/resources/wikimedia/prettify.sh b/catalog/tests/dags/providers/provider_api_scripts/resources/wikimedia/prettify.shdeleted file mode 100755index d2874c864..000000000--- a/catalog/tests/dags/providers/provider_api_scripts/resources/wikimedia/prettify.sh+++ /dev/null@@ -1,5 +0,0 @@-#!/bin/bash--T=$(mktemp)-jq '.' "$1" >"$T"-mv "$T" "$1"diff --git a/documentation/catalog/reference/DAGs.md b/documentation/catalog/reference/DAGs.mdindex 15a6875e0..748166f95 100644--- a/documentation/catalog/reference/DAGs.md+++ b/documentation/catalog/reference/DAGs.md@@ -20,7 +20,6 @@ The following are DAGs grouped by their primary tag:1. [Elasticsearch](#elasticsearch)1. [Maintenance](#maintenance)1. [Oauth](#oauth)-1. [Other](#other)1. [Popularity Refresh](#popularity-refresh)1. [Provider](#provider)1. [Provider Reingestion](#provider-reingestion)@@ -79,12 +78,6 @@ The following are DAGs grouped by their primary tag:| [`oauth2_authorization`](#oauth2_authorization) | `None` || [`oauth2_token_refresh`](#oauth2_token_refresh) | `0 */12 * * *` |-### Other--| DAG ID | Schedule Interval |-| --------------------------------------------------------- | ----------------- |-| [`flickr_thumbnails_removal`](#flickr_thumbnails_removal) | `None` |-### Popularity Refresh| DAG ID | Schedule Interval |@@ -151,7 +144,6 @@ The following is documentation associated with each DAG (where available):1. [`finnish_museums_workflow`](#finnish_museums_workflow)1. [`flickr_audit_sub_provider_workflow`](#flickr_audit_sub_provider_workflow)1. [`flickr_reingestion_workflow`](#flickr_reingestion_workflow)-1. [`flickr_thumbnails_removal`](#flickr_thumbnails_removal)1. [`flickr_workflow`](#flickr_workflow)1. [`freesound_workflow`](#freesound_workflow)1. [`image_data_refresh`](#image_data_refresh)@@ -832,11 +824,6 @@ Output: TSV file containing the images and the respective meta-data.Notes: https://www.flickr.com/help/terms/api Rate limit: 3600 requests per hour.-### `flickr_thumbnails_removal`--One-time run DAG to remove progressively all the old Flickr thumbnails, as they-were determined to be unsuitable for the Openverse UI requirements.-### `flickr_workflow`Content Provider: Flickr