Skip to content

Commit

Permalink
Remove debugging print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron-collier committed Jan 8, 2025
1 parent e8b3efa commit d9a6b63
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
9 changes: 4 additions & 5 deletions dlme_airflow/drivers/iiif_json_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ def _open_manifest(self, manifest: dict) -> Optional[dict]:

# Handles the thumbnail field provided in the collection manifest
record.update({"thumbnail": manifest.get("thumbnail")})
print(f"record: {record}")
return record

def _extract_specified_fields(self, iiif_manifest: dict) -> dict:
Expand Down Expand Up @@ -91,7 +90,7 @@ def _optional_field_warning(self, id, field, expression, optional):
if optional is True:
logging.debug(f"{id} missing optional field: '{field}'; searched path: '{expression}'")
return

logging.warning(f"{id} missing required field: '{field}'; searched path: '{expression}'")


Expand All @@ -103,7 +102,7 @@ def _extract_manifest_metadata(
for row in iiif_manifest_metadata:
(label, values) = self._extract_metadata_for_row(row)
output.setdefault(label, []).extend(values)

return output

def _extract_metadata_for_row(self, row):
Expand Down Expand Up @@ -168,10 +167,10 @@ def _stringify_and_strip_if_list(record) -> list[str]:
result_list = []
for data in record:
result_list.append(_stringify_and_strip_if_list(data))

if len(result_list) == 1:
return result_list[0]

return result_list


Expand Down
7 changes: 4 additions & 3 deletions tests/drivers/test_iiif_json_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import logging
import pytest
import requests
import pandas as pd

from dlme_airflow.drivers.iiif_json_v3 import IiifV3JsonSource

Expand Down Expand Up @@ -30,7 +29,8 @@ def status_code(self):

@staticmethod
def json():
with open("tests/data/iiif_v3/collection_items.json") as f: data = json.load(f)
with open("tests/data/iiif_v3/collection_items.json") as f:
data = json.load(f)
return data

class MockIIIFManifestResponse:
Expand All @@ -40,7 +40,8 @@ def status_code(self):

@staticmethod
def json():
with open("tests/data/iiif_v3/item_manifest.json") as f: data = json.load(f)
with open("tests/data/iiif_v3/item_manifest.json") as f:
data = json.load(f)
return data


Expand Down

0 comments on commit d9a6b63

Please sign in to comment.