sul-dlss / libsys-airflow

Airflow DAGS for migrating and managing ILS data into FOLIO along with other LibSys workflows
Apache License 2.0
5 stars 0 forks source link

Updated digital bookplates metadata not in email #1406

Closed shelleydoljack closed 2 weeks ago

shelleydoljack commented 2 weeks ago

I ran fetch_digital_bookplates manually to pick up the updated data Andrew fixed in the SDR. The email for this run showed no updated bookplates.

New digital bookplates metadata

No new digital bookplates this run.

Updated digital bookplates metadata

No updated digital bookplates metadata this run.

Here is the task instances for one of the bookplates that was updated: https://sul-libsys-airflow-prod.stanford.edu/task?dag_id=fetch_digital_bookplates&task_id=retrieve-process-db.extract_bookplate_metadata&execution_date=2024-11-05T18:02:14.829056%2B00:00&map_index=845

And here is the original task instance for when it was new: https://sul-libsys-airflow-prod.stanford.edu/task?dag_id=fetch_digital_bookplates&task_id=retrieve-process-db.extract_bookplate_metadata&execution_date=2024-10-23T14:00:00%2B00:00&map_index=845

shelleydoljack commented 2 weeks ago

The XCOM for the next task, add_update_model, shows that it is in the updated key: https://sul-libsys-airflow-prod.stanford.edu/xcom?dag_id=fetch_digital_bookplates&task_id=retrieve-process-db.add_update_model&execution_date=2024-11-05T18:02:14.829056%2B00:00&map_index=845

But somehow this didn't get processed correctly for the email.

shelleydoljack commented 2 weeks ago

I'm not sure that this is correct: https://github.com/sul-dlss/libsys-airflow/blob/8831b1e8fdec5b9dfcb59a2e600247344fc83c73/libsys_airflow/plugins/digital_bookplates/purl_fetcher.py#L173-L174 The key in the XCOM for add_update_model is "updated" not "updates". The filter_updates_errors task is taking a list of add_update_model dynamic tasks that have keys "new", "updated", or "failure". I think the input for filter_updates_errors is not correct.

shelleydoljack commented 2 weeks ago

I re-ran the filter_updates_error task in dev and the XCOM looks right but the email sent was blank. :( https://sul-libsys-airflow-dev.stanford.edu/dags/fetch_digital_bookplates/grid?run_id=scheduled__2024-10-30T14%3A00%3A00%2B00%3A00&execution_date=2024-10-30+14%3A00%3A00%2B00%3A00&tab=graph&dag_run_id=scheduled__2024-10-30T14%3A00%3A00%2B00%3A00&task_id=filter_updates_errors

XCOM:

{
  "failures": [],
  "new": [],
  "updated": [
    {
      "druid": "hg751wk2676",
      "image_filename": "hg751wk2676_00_0001.jp2",
      "failure": None,
      "fund_name": "NORDMAN",
      "title": "The C. Eric Nordman Library Fund",
      "reason": "fund_name changed",
      "fund_uuid": "42b59d77-9ce6-4e41-b044-cd7946556656",
      "db_id": 5408
    },
    {
      "druid": "hn562qv8928",
      "image_filename": "hn562qv8928_00_0001.jp2",
      "failure": None,
      "fund_name": "STICKY",
      "title": "The Ernest "Sticky" Wilson Stanford History Fund",
      "reason": "fund_name changed",
      "fund_uuid": "10bcee05-8f76-401b-aa60-b134caa913dc",
      "db_id": 5812
    },
    {
      "druid": "vy482pt7540",
      "image_filename": "vy482pt7540_00_0001.jp2",
      "failure": None,
      "fund_name": "KLEINH",
      "title": "The Herbert A. Klein Book Fund",
      "reason": "fund_name changed",
      "fund_uuid": "00551bdb-6fc2-43a2-a97d-60678190791f",
      "db_id": 5108
    },
    {
      "druid": "ft538hz3774",
      "image_filename": "ft538hz3774_00_0001.jp2",
      "failure": None,
      "fund_name": "BAYSINGER",
      "title": "The Grace Baysinger Fund for Chemistry and Chemical Engineering",
      "reason": "image_filename changed, fund_name changed",
      "fund_uuid": "a63e0cc6-ab13-4abe-aed0-fba816c8235b",
      "db_id": 5888
    },
    {
      "druid": "gs202dq2239",
      "image_filename": "gs202dq2239_00_0001.jp2",
      "failure": None,
      "fund_name": "SYLVAIN",
      "title": "The Sylvain-Jonassaint Fund",
      "reason": "image_filename changed, fund_name changed",
      "fund_uuid": "e5981581-9ba6-4e77-bcf2-1d2a0ae17719",
      "db_id": 5889
    },
    {
      "druid": "mq919pt0901",
      "image_filename": "mq919pt0901_00_0001.jp2",
      "failure": None,
      "fund_name": "MANDEV",
      "title": "The Steven Mandeville-Gamble Book Fund for Queer Literature",
      "reason": "image_filename changed, fund_name changed",
      "fund_uuid": "d4b89e36-52dc-4a98-b0aa-4de134fed581",
      "db_id": 5890
    },
    {
      "druid": "qq572kf4435",
      "image_filename": "qq572kf4435_00_0001.jp2",
      "failure": None,
      "fund_name": "LOWPB",
      "title": "The Patricia VR and Burton Low Library Fund",
      "reason": "image_filename changed, fund_name changed",
      "fund_uuid": "6ba59612-6d11-4a89-839f-07b484aa9b12",
      "db_id": 5892
    },
    {
      "druid": "rw914mc6789",
      "image_filename": "rw914mc6789_00_0001.jp2",
      "failure": None,
      "fund_name": "JORDANLIT",
      "title": "The David and Maureen Jordan Asian Literature Book Fund",
      "reason": "image_filename changed, fund_name changed",
      "fund_uuid": "8647356c-110a-453f-b4bb-26bc71c15c50",
      "db_id": 5891
    }
  ]
}

Email:

New digital bookplates metadata

No new digital bookplates this run.

Updated digital bookplates metadata

No updated digital bookplates metadata this run.