Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
Retire Walters Art Museum provider script (#786)
Madison Swain-Bowden46c2c161c203
diff --git a/DAGs.md b/DAGs.mdindex c09916317..da5334b49 100644--- a/DAGs.md+++ b/DAGs.md@@ -92,7 +92,6 @@ The following are DAGs grouped by their primary tag:| [`smithsonian_workflow`](#smithsonian_workflow) | `@weekly` | `False` | image || `smk_workflow` | `@monthly` | `False` | image || [`stocksnap_workflow`](#stocksnap_workflow) | `@monthly` | `False` | image |-| [`walters_workflow`](#walters_workflow) | `@monthly` | `False` | image || [`wikimedia_commons_workflow`](#wikimedia_commons_workflow) | `@daily` | `True` | image, audio || [`wordpress_workflow`](#wordpress_workflow) | `@monthly` | `False` | image |@@ -133,7 +132,6 @@ The following is documentation associated with each DAG (where available):1. [`smithsonian_workflow`](#smithsonian_workflow)1. [`stocksnap_workflow`](#stocksnap_workflow)1. [`tsv_to_postgres_loader`](#tsv_to_postgres_loader)- 1. [`walters_workflow`](#walters_workflow)1. [`wikimedia_commons_workflow`](#wikimedia_commons_workflow)1. [`wikimedia_reingestion_workflow`](#wikimedia_reingestion_workflow)1. [`wordpress_workflow`](#wordpress_workflow)@@ -586,20 +584,6 @@ https://github.com/creativecommons/cccatalog/issues/334)-## `walters_workflow`---Content Provider: Walters Art Museum--ETL Process: Use the API to identify all CC licensed images.--Output: TSV file containing the images and the- respective meta-data.--Notes: http://api.thewalters.org/- Rate limit: 250000 Per Day Per Key--## `wikimedia_commons_workflow`diff --git a/env.template b/env.templateindex 2f913c901..58f5324e1 100644--- a/env.template+++ b/env.template@@ -24,7 +24,6 @@ AIRFLOW_VAR_ENVIRONMENT=dev# API Keys######################################################################################### See: https://airflow.apache.org/docs/apache-airflow/stable/howto/variable.html#storing-variables-in-environment-variables-AIRFLOW_VAR_API_KEY_WALTERS_ART_MUSEUM=not_setAIRFLOW_VAR_API_KEY_BROOKLYN_MUSEUM=not_setAIRFLOW_VAR_API_KEY_DATA_GOV=not_setAIRFLOW_VAR_API_KEY_EUROPEANA=not_setdiff --git a/openverse_catalog/dags/providers/provider_workflows.py b/openverse_catalog/dags/providers/provider_workflows.pyindex 415c25b31..588aa5818 100644--- a/openverse_catalog/dags/providers/provider_workflows.py+++ b/openverse_catalog/dags/providers/provider_workflows.py@@ -205,10 +205,6 @@ PROVIDER_WORKFLOWS = [provider_script="stocksnap",ingestion_callable=StockSnapDataIngester,),- ProviderWorkflow(- provider_script="walters",- start_date=datetime(2020, 9, 27),- ),ProviderWorkflow(provider_script="wikimedia_commons",ingestion_callable=WikimediaCommonsDataIngester,diff --git a/openverse_catalog/dags/providers/provider_api_scripts/walters.py b/openverse_catalog/dags/retired/providers/provider_api_scripts/walters.pysimilarity index 100%rename from openverse_catalog/dags/providers/provider_api_scripts/walters.pyrename to openverse_catalog/dags/retired/providers/provider_api_scripts/walters.pydiff --git a/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/full_image_object.json b/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/full_image_object.jsondeleted file mode 100644index 96566ada3..000000000--- a/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/full_image_object.json+++ /dev/null@@ -1,40 +0,0 @@-{- "Classification": "Manuscripts & Rare Books",- "Collection": "Manuscripts",- "CollectionID": 3,- "Creator": "Iranian",- "CreditLine": "Acquired by Henry Walters",- "Culture": "Islamic",- "DateBeginYear": 1601,- "DateEndYear": 1700,- "DateText": "11th century AH/AD 17th century",- "Description": "abc",- "Dimensions": "H: 15 3/16 x W: 10 1/16 in. (38.5 x 25.5 cm)",- "DisplayLocation": "Not On View",- "Dynasty": "Safavid Dynasty",- "ExhibIDs": "",- "GeoIDs": "1501112, 1507667",- "Images": "CPS_W.569.4a_Fp_DD.jpg",- "Inscriptions": null,- "Keywords": "Koran; Prayer; Qur`an; Arabic; Islamic; Safavid; Book; Calligraphy; Codex; Illumination; Manuscript; Ornament; Iran; Scripture; Fortune-telling; Devotion",- "Medium": "ink and pigments on thick cream-colored, gold-flecked paper",- "ObjectID": 2,- "ObjectName": "illuminated manuscripts; folios (leaves)",- "ObjectNumber": "W.569.4A",- "OnView": 0,- "Period": "Safavid",- "PrimaryImage": {- "Large": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=250",- "Medium": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=150",- "Raw": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg",- "Small": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=100",- "Tiny": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=50"- },- "Provenance": "Henry Walters, Baltimore [date and mode of acquisition unknown]; Walters Art Museum, 1931, by bequest.",- "PublicAccessDate": "2014-04-25T13:19:25.22",- "Reign": null,- "ResourceURL": "http://art.thewalters.org/detail/2",- "SortNumber": "W5694A",- "Style": null,- "Title": "Leaf from Qur'an"-}diff --git a/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/items_list_example.json b/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/items_list_example.jsondeleted file mode 100644index f91d9fa44..000000000--- a/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/items_list_example.json+++ /dev/null@@ -1,42 +0,0 @@-[- {- "Classification": "Manuscripts & Rare Books",- "Collection": "Manuscripts",- "CollectionID": 3,- "Creator": "Iranian",- "CreditLine": "Acquired by Henry Walters",- "Culture": "Islamic",- "DateBeginYear": 1601,- "DateEndYear": 1700,- "DateText": "11th century AH/AD 17th century",- "Description": "abc",- "Dimensions": "H: 15 3/16 x W: 10 1/16 in. (38.5 x 25.5 cm)",- "DisplayLocation": "Not On View",- "Dynasty": "Safavid Dynasty",- "ExhibIDs": "",- "GeoIDs": "1501112, 1507667",- "Images": "CPS_W.569.4a_Fp_DD.jpg",- "Inscriptions": null,- "Keywords": "Koran; Prayer; Qur`an; Arabic; Islamic; Safavid; Book; Calligraphy; Codex; Illumination; Manuscript; Ornament; Iran; Scripture; Fortune-telling; Devotion",- "Medium": "ink and pigments on thick cream-colored, gold-flecked paper",- "ObjectID": 2,- "ObjectName": "illuminated manuscripts; folios (leaves)",- "ObjectNumber": "W.569.4A",- "OnView": 0,- "Period": "Safavid",- "PrimaryImage": {- "Large": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=250",- "Medium": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=150",- "Raw": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg",- "Small": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=100",- "Tiny": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=50"- },- "Provenance": "Henry Walters, Baltimore [date and mode of acquisition unknown]; Walters Art Museum, 1931, by bequest.",- "PublicAccessDate": "2014-04-25T13:19:25.22",- "Reign": null,- "ResourceURL": "http://art.thewalters.org/detail/2",- "SortNumber": "W5694A",- "Style": null,- "Title": "Leaf from Qur'an"- }-]diff --git a/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/no_creator_info.json b/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/no_creator_info.jsondeleted file mode 100644index 8c179cbe6..000000000--- a/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/no_creator_info.json+++ /dev/null@@ -1,39 +0,0 @@-{- "Classification": "Manuscripts & Rare Books",- "Collection": "Manuscripts",- "CollectionID": 3,- "CreditLine": "Acquired by Henry Walters",- "Culture": "Islamic",- "DateBeginYear": 1601,- "DateEndYear": 1700,- "DateText": "11th century AH/AD 17th century",- "Description": "abc",- "Dimensions": "H: 15 3/16 x W: 10 1/16 in. (38.5 x 25.5 cm)",- "DisplayLocation": "Not On View",- "Dynasty": "Safavid Dynasty",- "ExhibIDs": "",- "GeoIDs": "1501112, 1507667",- "Images": "CPS_W.569.4a_Fp_DD.jpg",- "Inscriptions": null,- "Keywords": "Koran; Prayer; Qur`an; Arabic; Islamic; Safavid; Book; Calligraphy; Codex; Illumination; Manuscript; Ornament; Iran; Scripture; Fortune-telling; Devotion",- "Medium": "ink and pigments on thick cream-colored, gold-flecked paper",- "ObjectID": 2,- "ObjectName": "illuminated manuscripts; folios (leaves)",- "ObjectNumber": "W.569.4A",- "OnView": 0,- "Period": "Safavid",- "PrimaryImage": {- "Large": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=250",- "Medium": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=150",- "Raw": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg",- "Small": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=100",- "Tiny": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=50"- },- "Provenance": "Henry Walters, Baltimore [date and mode of acquisition unknown]; Walters Art Museum, 1931, by bequest.",- "PublicAccessDate": "2014-04-25T13:19:25.22",- "Reign": null,- "ResourceURL": "http://art.thewalters.org/detail/2",- "SortNumber": "W5694A",- "Style": null,- "Title": "Leaf from Qur'an"-}diff --git a/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/no_foreign_id.json b/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/no_foreign_id.jsondeleted file mode 100644index 4c1c55078..000000000--- a/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/no_foreign_id.json+++ /dev/null@@ -1,39 +0,0 @@-{- "Classification": "Manuscripts & Rare Books",- "Collection": "Manuscripts",- "CollectionID": 3,- "Creator": "Iranian",- "CreditLine": "Acquired by Henry Walters",- "Culture": "Islamic",- "DateBeginYear": 1601,- "DateEndYear": 1700,- "DateText": "11th century AH/AD 17th century",- "Description": "abc",- "Dimensions": "H: 15 3/16 x W: 10 1/16 in. (38.5 x 25.5 cm)",- "DisplayLocation": "Not On View",- "Dynasty": "Safavid Dynasty",- "ExhibIDs": "",- "GeoIDs": "1501112, 1507667",- "Images": "CPS_W.569.4a_Fp_DD.jpg",- "Inscriptions": null,- "Keywords": "Koran; Prayer; Qur`an; Arabic; Islamic; Safavid; Book; Calligraphy; Codex; Illumination; Manuscript; Ornament; Iran; Scripture; Fortune-telling; Devotion",- "Medium": "ink and pigments on thick cream-colored, gold-flecked paper",- "ObjectID": 2,- "ObjectName": "illuminated manuscripts; folios (leaves)",- "OnView": 0,- "Period": "Safavid",- "PrimaryImage": {- "Large": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=250",- "Medium": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=150",- "Raw": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg",- "Small": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=100",- "Tiny": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=50"- },- "Provenance": "Henry Walters, Baltimore [date and mode of acquisition unknown]; Walters Art Museum, 1931, by bequest.",- "PublicAccessDate": "2014-04-25T13:19:25.22",- "Reign": null,- "ResourceURL": "http://art.thewalters.org/detail/2",- "SortNumber": "W5694A",- "Style": null,- "Title": "Leaf from Qur'an"-}diff --git a/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/no_foreign_landing_url.json b/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/no_foreign_landing_url.jsondeleted file mode 100644index 1d00db99d..000000000--- a/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/no_foreign_landing_url.json+++ /dev/null@@ -1,39 +0,0 @@-{- "Classification": "Manuscripts & Rare Books",- "Collection": "Manuscripts",- "CollectionID": 3,- "Creator": "Iranian",- "CreditLine": "Acquired by Henry Walters",- "Culture": "Islamic",- "DateBeginYear": 1601,- "DateEndYear": 1700,- "DateText": "11th century AH/AD 17th century",- "Description": "abc",- "Dimensions": "H: 15 3/16 x W: 10 1/16 in. (38.5 x 25.5 cm)",- "DisplayLocation": "Not On View",- "Dynasty": "Safavid Dynasty",- "ExhibIDs": "",- "GeoIDs": "1501112, 1507667",- "Images": "CPS_W.569.4a_Fp_DD.jpg",- "Inscriptions": null,- "Keywords": "Koran; Prayer; Qur`an; Arabic; Islamic; Safavid; Book; Calligraphy; Codex; Illumination; Manuscript; Ornament; Iran; Scripture; Fortune-telling; Devotion",- "Medium": "ink and pigments on thick cream-colored, gold-flecked paper",- "ObjectID": 2,- "ObjectName": "illuminated manuscripts; folios (leaves)",- "ObjectNumber": "W.569.4A",- "OnView": 0,- "Period": "Safavid",- "PrimaryImage": {- "Large": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=250",- "Medium": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=150",- "Raw": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg",- "Small": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=100",- "Tiny": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=50"- },- "Provenance": "Henry Walters, Baltimore [date and mode of acquisition unknown]; Walters Art Museum, 1931, by bequest.",- "PublicAccessDate": "2014-04-25T13:19:25.22",- "Reign": null,- "SortNumber": "W5694A",- "Style": null,- "Title": "Leaf from Qur'an"-}diff --git a/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/no_image_url.json b/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/no_image_url.jsondeleted file mode 100644index 9c27e85cb..000000000--- a/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/no_image_url.json+++ /dev/null@@ -1,39 +0,0 @@-{- "Classification": "Manuscripts & Rare Books",- "Collection": "Manuscripts",- "CollectionID": 3,- "Creator": "Iranian",- "CreditLine": "Acquired by Henry Walters",- "Culture": "Islamic",- "DateBeginYear": 1601,- "DateEndYear": 1700,- "DateText": "11th century AH/AD 17th century",- "Description": "abc",- "Dimensions": "H: 15 3/16 x W: 10 1/16 in. (38.5 x 25.5 cm)",- "DisplayLocation": "Not On View",- "Dynasty": "Safavid Dynasty",- "ExhibIDs": "",- "GeoIDs": "1501112, 1507667",- "Images": "CPS_W.569.4a_Fp_DD.jpg",- "Inscriptions": null,- "Keywords": "Koran; Prayer; Qur`an; Arabic; Islamic; Safavid; Book; Calligraphy; Codex; Illumination; Manuscript; Ornament; Iran; Scripture; Fortune-telling; Devotion",- "Medium": "ink and pigments on thick cream-colored, gold-flecked paper",- "ObjectID": 2,- "ObjectName": "illuminated manuscripts; folios (leaves)",- "ObjectNumber": "W.569.4A",- "OnView": 0,- "Period": "Safavid",- "PrimaryImage": {- "Large": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=250",- "Medium": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=150",- "Small": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=100",- "Tiny": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=50"- },- "Provenance": "Henry Walters, Baltimore [date and mode of acquisition unknown]; Walters Art Museum, 1931, by bequest.",- "PublicAccessDate": "2014-04-25T13:19:25.22",- "Reign": null,- "ResourceURL": "http://art.thewalters.org/detail/2",- "SortNumber": "W5694A",- "Style": null,- "Title": "Leaf from Qur'an"-}diff --git a/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/no_meta_data.json b/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/no_meta_data.jsondeleted file mode 100644index 887d46948..000000000--- a/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/no_meta_data.json+++ /dev/null@@ -1,33 +0,0 @@-{- "CollectionID": 3,- "Creator": "Iranian",- "Culture": "Islamic",- "DateBeginYear": 1601,- "DateEndYear": 1700,- "DateText": "11th century AH/AD 17th century",- "Dimensions": "H: 15 3/16 x W: 10 1/16 in. (38.5 x 25.5 cm)",- "DisplayLocation": "Not On View",- "Dynasty": "Safavid Dynasty",- "ExhibIDs": "",- "GeoIDs": "1501112, 1507667",- "Images": "CPS_W.569.4a_Fp_DD.jpg",- "Inscriptions": null,- "Keywords": "Koran; Prayer; Qur`an; Arabic; Islamic; Safavid; Book; Calligraphy; Codex; Illumination; Manuscript; Ornament; Iran; Scripture; Fortune-telling; Devotion",- "ObjectID": 2,- "ObjectName": "illuminated manuscripts; folios (leaves)",- "OnView": 0,- "Period": "Safavid",- "PrimaryImage": {- "Large": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=250",- "Medium": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=150",- "Raw": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg",- "Small": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=100",- "Tiny": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=50"- },- "Provenance": "Henry Walters, Baltimore [date and mode of acquisition unknown]; Walters Art Museum, 1931, by bequest.",- "Reign": null,- "ResourceURL": "http://art.thewalters.org/detail/2",- "SortNumber": "W5694A",- "Style": null,- "Title": "Leaf from Qur'an"-}diff --git a/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/no_thumbnail_url.json b/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/no_thumbnail_url.jsondeleted file mode 100644index 3ba2d3c23..000000000--- a/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/no_thumbnail_url.json+++ /dev/null@@ -1,39 +0,0 @@-{- "Classification": "Manuscripts & Rare Books",- "Collection": "Manuscripts",- "CollectionID": 3,- "Creator": "Iranian",- "CreditLine": "Acquired by Henry Walters",- "Culture": "Islamic",- "DateBeginYear": 1601,- "DateEndYear": 1700,- "DateText": "11th century AH/AD 17th century",- "Description": "abc",- "Dimensions": "H: 15 3/16 x W: 10 1/16 in. (38.5 x 25.5 cm)",- "DisplayLocation": "Not On View",- "Dynasty": "Safavid Dynasty",- "ExhibIDs": "",- "GeoIDs": "1501112, 1507667",- "Images": "CPS_W.569.4a_Fp_DD.jpg",- "Inscriptions": null,- "Keywords": "Koran; Prayer; Qur`an; Arabic; Islamic; Safavid; Book; Calligraphy; Codex; Illumination; Manuscript; Ornament; Iran; Scripture; Fortune-telling; Devotion",- "Medium": "ink and pigments on thick cream-colored, gold-flecked paper",- "ObjectID": 2,- "ObjectName": "illuminated manuscripts; folios (leaves)",- "ObjectNumber": "W.569.4A",- "OnView": 0,- "Period": "Safavid",- "PrimaryImage": {- "Large": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=250",- "Medium": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=150",- "Raw": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg",- "Tiny": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=50"- },- "Provenance": "Henry Walters, Baltimore [date and mode of acquisition unknown]; Walters Art Museum, 1931, by bequest.",- "PublicAccessDate": "2014-04-25T13:19:25.22",- "Reign": null,- "ResourceURL": "http://art.thewalters.org/detail/2",- "SortNumber": "W5694A",- "Style": null,- "Title": "Leaf from Qur'an"-}diff --git a/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/no_title.json b/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/no_title.jsondeleted file mode 100644index ba70b1b1c..000000000--- a/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/no_title.json+++ /dev/null@@ -1,39 +0,0 @@-{- "Classification": "Manuscripts & Rare Books",- "Collection": "Manuscripts",- "CollectionID": 3,- "Creator": "Iranian",- "CreditLine": "Acquired by Henry Walters",- "Culture": "Islamic",- "DateBeginYear": 1601,- "DateEndYear": 1700,- "DateText": "11th century AH/AD 17th century",- "Description": "abc",- "Dimensions": "H: 15 3/16 x W: 10 1/16 in. (38.5 x 25.5 cm)",- "DisplayLocation": "Not On View",- "Dynasty": "Safavid Dynasty",- "ExhibIDs": "",- "GeoIDs": "1501112, 1507667",- "Images": "CPS_W.569.4a_Fp_DD.jpg",- "Inscriptions": null,- "Keywords": "Koran; Prayer; Qur`an; Arabic; Islamic; Safavid; Book; Calligraphy; Codex; Illumination; Manuscript; Ornament; Iran; Scripture; Fortune-telling; Devotion",- "Medium": "ink and pigments on thick cream-colored, gold-flecked paper",- "ObjectID": 2,- "ObjectName": "illuminated manuscripts; folios (leaves)",- "ObjectNumber": "W.569.4A",- "OnView": 0,- "Period": "Safavid",- "PrimaryImage": {- "Large": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=250",- "Medium": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=150",- "Raw": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg",- "Small": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=100",- "Tiny": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=50"- },- "Provenance": "Henry Walters, Baltimore [date and mode of acquisition unknown]; Walters Art Museum, 1931, by bequest.",- "PublicAccessDate": "2014-04-25T13:19:25.22",- "Reign": null,- "ResourceURL": "http://art.thewalters.org/detail/2",- "SortNumber": "W5694A",- "Style": null-}diff --git a/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/partial_meta_data.json b/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/partial_meta_data.jsondeleted file mode 100644index bfb8aef54..000000000--- a/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/partial_meta_data.json+++ /dev/null@@ -1,37 +0,0 @@-{- "Collection": "Manuscripts",- "CollectionID": 3,- "Creator": "Iranian",- "Culture": "Islamic",- "DateBeginYear": 1601,- "DateEndYear": 1700,- "DateText": "11th century AH/AD 17th century",- "Dimensions": "H: 15 3/16 x W: 10 1/16 in. (38.5 x 25.5 cm)",- "DisplayLocation": "Not On View",- "Dynasty": "Safavid Dynasty",- "ExhibIDs": "",- "GeoIDs": "1501112, 1507667",- "Images": "CPS_W.569.4a_Fp_DD.jpg",- "Inscriptions": null,- "Keywords": "Koran; Prayer; Qur`an; Arabic; Islamic; Safavid; Book; Calligraphy; Codex; Illumination; Manuscript; Ornament; Iran; Scripture; Fortune-telling; Devotion",- "Medium": "ink and pigments on thick cream-colored, gold-flecked paper",- "ObjectID": 2,- "ObjectName": "illuminated manuscripts; folios (leaves)",- "ObjectNumber": "W.569.4A",- "OnView": 0,- "Period": "Safavid",- "PrimaryImage": {- "Large": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=250",- "Medium": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=150",- "Raw": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg",- "Small": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=100",- "Tiny": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=50"- },- "Provenance": "Henry Walters, Baltimore [date and mode of acquisition unknown]; Walters Art Museum, 1931, by bequest.",- "PublicAccessDate": "2014-04-25T13:19:25.22",- "Reign": null,- "ResourceURL": "http://art.thewalters.org/detail/2",- "SortNumber": "W5694A",- "Style": null,- "Title": "Leaf from Qur'an"-}diff --git a/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/walters_full_response_example.json b/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/walters_full_response_example.jsondeleted file mode 100644index 4669837ac..000000000--- a/tests/dags/providers/provider_api_scripts/resources/waltersartmuseum/walters_full_response_example.json+++ /dev/null@@ -1,51 +0,0 @@-{- "Items": [- {- "Classification": "Manuscripts & Rare Books",- "Collection": "Manuscripts",- "CollectionID": 3,- "Creator": "Iranian",- "CreditLine": "Acquired by Henry Walters",- "Culture": "Islamic",- "DateBeginYear": 1601,- "DateEndYear": 1700,- "DateText": "11th century AH/AD 17th century",- "Description": "abc",- "Dimensions": "H: 15 3/16 x W: 10 1/16 in. (38.5 x 25.5 cm)",- "DisplayLocation": "Not On View",- "Dynasty": "Safavid Dynasty",- "ExhibIDs": "",- "GeoIDs": "1501112, 1507667",- "Images": "CPS_W.569.4a_Fp_DD.jpg",- "Inscriptions": null,- "Keywords": "Koran; Prayer; Qur`an; Arabic; Islamic; Safavid; Book; Calligraphy; Codex; Illumination; Manuscript; Ornament; Iran; Scripture; Fortune-telling; Devotion",- "Medium": "ink and pigments on thick cream-colored, gold-flecked paper",- "ObjectID": 2,- "ObjectName": "illuminated manuscripts; folios (leaves)",- "ObjectNumber": "W.569.4A",- "OnView": 0,- "Period": "Safavid",- "PrimaryImage": {- "Large": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=250",- "Medium": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=150",- "Raw": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg",- "Small": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=100",- "Tiny": "http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg?width=50"- },- "Provenance": "Henry Walters, Baltimore [date and mode of acquisition unknown]; Walters Art Museum, 1931, by bequest.",- "PublicAccessDate": "2014-04-25T13:19:25.22",- "Reign": null,- "ResourceURL": "http://art.thewalters.org/detail/2",- "SortNumber": "W5694A",- "Style": null,- "Title": "Leaf from Qur'an"- }- ],- "NextPage": false,- "Page": 1,- "PageSize": 1,- "PrevPage": false,- "ReturnCode": 200,- "ReturnMessage": [],- "ReturnStatus": true-}diff --git a/tests/dags/providers/provider_api_scripts/test_walters.py b/tests/dags/providers/provider_api_scripts/test_walters.pydeleted file mode 100644index bf2777648..000000000--- a/tests/dags/providers/provider_api_scripts/test_walters.py+++ /dev/null@@ -1,215 +0,0 @@-import json-import logging-import os-from unittest.mock import MagicMock, patch--import requests-from providers.provider_api_scripts import walters as wam---RESOURCES = os.path.join(- os.path.abspath(os.path.dirname(__file__)), "resources/waltersartmuseum"-)--logging.basicConfig(- format="%(asctime)s - %(name)s - %(levelname)s: %(message)s", level=logging.DEBUG-)--logger = logging.getLogger(__name__)---def _get_resource_json(json_resource):- with open(os.path.join(RESOURCES, json_resource)) as file:- json_resource = json.load(file)- return json_resource---# _get_image_list test suite-def test_get_image_list_retries_with_none_response():- with patch.object(- wam.delayed_requester, "get_response_json", return_value=None- ) as mock_get:- wam._get_image_list("some_class", retries=3)-- assert mock_get.call_count == 1---def test_get_image_list_retries_with_non_ok_response():- response_json = _get_resource_json("walters_full_response_example.json")- r = requests.Response()- r.status_code = 504- r.json = MagicMock(return_value=response_json)- with patch.object(- wam.delayed_requester, "get_response_json", return_value=r.json()- ) as mock_get:- wam._get_image_list("some_class", retries=3)-- assert mock_get.call_count == 1---def test_get_image_list_with_full_response():- response_json = _get_resource_json("walters_full_response_example.json")- r = requests.Response()- r.status_code = 200- r.json = MagicMock(return_value=response_json)- with patch.object(- wam.delayed_requester, "get_response_json", return_value=r.json()- ) as mock_get:- image_list = wam._get_image_list("Manuscripts & Rare Books", retries=3)-- # Here image list is same as items list because test example has only one- # page and image. In case of more than one pages the image list will be- # contain all images of more than one items list.- expect_image_list = _get_resource_json("items_list_example.json")- assert mock_get.call_count == 1- assert image_list == expect_image_list---# _build_query_param test suite-# This test fails if default constants change.-def test_build_query_param_default():- walters_api_key = "notset"- actual_param_made = wam._build_query_param(apikey=walters_api_key)- expected_param = {- "accept": "json",- "apikey": walters_api_key,- "pageSize": 100,- "orderBy": "classification",- "classification": None,- "Page": 1,- }- assert actual_param_made == expected_param---def test_build_query_param_given():- walters_api_key = "notset"- class_param = "someclass"- actual_param_made = wam._build_query_param(- class_param=class_param, apikey=walters_api_key- )- expected_param = {- "accept": "json",- "apikey": walters_api_key,- "pageSize": 100,- "orderBy": "classification",- "classification": class_param,- "Page": 1,- }- assert actual_param_made == expected_param---# _extract_image_list_from_json test suite-def test_extract_items_list_from_json_returns_expected_output():- json_response_inpydict_form = _get_resource_json(- "walters_full_response_example.json"- )- actual_items_list = wam._extract_items_list_from_json(json_response_inpydict_form)- expect_items_list = _get_resource_json("items_list_example.json")- assert actual_items_list == expect_items_list---def test_extract_items_list_from_json_returns_nones_given_false_return_stat():- test_dict = {"ReturnStatus": False, "ReturnCode": 404}- assert wam._extract_items_list_from_json(test_dict) is None---def test_extract_items_list_from_json_handles_missing_Items():- test_dict = {"ReturnStatus": True, "ReturnCode": 200}- assert wam._extract_items_list_from_json(test_dict) is None---def test_extract_items_list_from_json_handles_missing_imgs_in_Items():- test_dict = {"Items": [], "ReturnStatus": True, "ReturnCode": 200}- assert wam._extract_items_list_from_json(test_dict) is None---def test_extract_items_list_from_json_returns_nones_given_none_json():- assert wam._extract_items_list_from_json(None) is None---# _process_image test suite-def test_process_image_returns_expected_output_given_right_input():- image = _get_resource_json("full_image_object.json")- with patch.object(wam.image_store, "add_item", return_value=100) as mock_add_item:- total_images = wam._process_image(image)-- expect_meta_data = {- "ObjectNumber": "W.569.4A",- "PublicAccessDate": "2014-04-25T13:19:25.22",- "Collection": "Manuscripts",- "Medium": "ink and pigments on thick cream-colored, gold-flecked paper",- "Classification": "Manuscripts & Rare Books",- "Description": "abc",- "CreditLine": "Acquired by Henry Walters",- }-- mock_add_item.assert_called_once_with(- foreign_landing_url="http://art.thewalters.org/detail/2",- image_url="http://static.thewalters.org/images/CPS_W.569.4a_Fp_DD.jpg",- license_url="https://creativecommons.org/publicdomain/zero/1.0/",- foreign_identifier="W.569.4A",- creator="Iranian",- creator_url="https://art.thewalters.org/browse/iranian",- title="Leaf from Qur'an",- meta_data=expect_meta_data,- )-- assert total_images == 100---# _get_creator_info test suite-def test_get_creator_info_returns_expected_output_given_right_input():- response_json = _get_resource_json("full_image_object.json")- actual_creator, actual_creator_url = wam._get_creator_info(response_json)- expected_creator = "Iranian"- expected_creator_url = "https://art.thewalters.org/browse/iranian"-- assert actual_creator == expected_creator- assert actual_creator_url == expected_creator_url---def test_get_creator_info_returns_none_given_no_creator_info():- response_json = _get_resource_json("no_creator_info.json")- actual_creator, actual_creator_url = wam._get_creator_info(response_json)- expected_creator = None- expected_creator_url = None-- assert actual_creator == expected_creator- assert actual_creator_url == expected_creator_url---# get_meta_data test suite-def test_get_image_meta_data_returns_full_meta_data_given_right_input():- response_json = _get_resource_json("full_image_object.json")- actual_metadata = wam._get_image_meta_data(response_json)- expected_metadata = {- "ObjectNumber": "W.569.4A",- "PublicAccessDate": "2014-04-25T13:19:25.22",- "Collection": "Manuscripts",- "Medium": "ink and pigments on thick cream-colored, gold-flecked paper",- "Classification": "Manuscripts & Rare Books",- "Description": "abc",- "CreditLine": "Acquired by Henry Walters",- }-- assert actual_metadata == expected_metadata---def test_get_image_meta_data_returns_partial_meta_data():- response_json = _get_resource_json("partial_meta_data.json")- actual_metadata = wam._get_image_meta_data(response_json)- expected_metadata = {- "ObjectNumber": "W.569.4A",- "PublicAccessDate": "2014-04-25T13:19:25.22",- "Collection": "Manuscripts",- "Medium": "ink and pigments on thick cream-colored, gold-flecked paper",- }-- assert actual_metadata == expected_metadata---def test_get_image_meta_data_return_empty_dict_given_no_meta_data():- response_json = _get_resource_json("no_meta_data.json")- actual_metadata = wam._get_image_meta_data(response_json)- expected_metadata = {}- assert actual_metadata == expected_metadata