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

Trigger digital_bookplate_979 from digital_bookplate_instances DAG failed #1353

Closed shelleydoljack closed 1 month ago

shelleydoljack commented 1 month ago

From the log:

  File "/opt/airflow/libsys_airflow/plugins/digital_bookplates/bookplates.py", line 252, in trigger_digital_bookplate_979_task
    for instance_uuid, funds in instances.items():
                                ^^^^^^^^^^^^^^^
AttributeError: 'LazyXComAccess' object has no attribute 'items'

https://sul-libsys-airflow-dev.stanford.edu/dags/digital_bookplate_instances/grid?run_id=manual__2024-10-24T23%3A15%3A40%2B00%3A00&execution_date=2024-10-24+23%3A15%3A40%2B00%3A00&tab=logs&dag_run_id=manual__2024-10-24T23%3A15%3A40%2B00%3A00&task_id=trigger_digital_bookplate_979_task__1

shelleydoljack commented 1 month ago

I'm pretty sure the problem is that the instances here, in the trigger_digital_bookplate_979 task, expects a dict but coming from the mapped tasks in the XCOM, it is a list. The return_value of instances_from_po_lines is:

{
  "4d618ed9-de64-4453-8d4e-9d83cb7aab78": [
    {
      "fund_name": "STEINMETZ",
      "druid": "nc092rd1979",
      "image_filename": "nc092rd1979_00_0001.jp2",
      "title": "Verna Pace Steinmetz Endowed Book Fund in History"
    }
  ]
}

but since it is one task from the mapped tasks, airflow turns it into a list. We need a test for trigger_digital_bookplate_979_task.