mjordan / islandora_workbench

A command-line tool for managing content in an Islandora 2 repository
MIT License
24 stars 40 forks source link

call to possibly nonexistent dependency in requests_cache module #841

Open edlington opened 1 week ago

edlington commented 1 week ago

Version of Islandora Workbench I'm using is commit hash: 4f3b5e06ea98569ee5ded28375df45a014cf6c1b

Below is error I'm getting when I run rollback task. I believe I have correct version of requests_cache module. My fix for now is to add enable_http_cache: false to islandora workbench task yml file I am using to run migration.

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
islandora_workbench/islandora_workbench/./workbench:3624 in │
│ <module>                                                                                         │
│                                                                                                  │
│   3621 │   if config["task"] == "update":                                                        │
│   3622 │   │   update()                                                                          │
│   3623 │   if config["task"] == "delete":                                                        │
│ ❱ 3624 │   │   delete()                                                                          │
│   3625 │   if config["task"] == "add_media":                                                     │
│   3626 │   │   add_media()                                                                       │
│   3627 │   if config["task"] == "delete_media":                                                  │
│                                                                                                  │
│islandora_workbench/islandora_workbench/./workbench:956 in  │
│ delete                                                                                           │
│                                                                                                  │
│    953 │   for row in csv_data:                                                                  │
│    954 │   │   # Delete expired items from request_cache before processing a row.                │
│    955 │   │   if config["enable_http_cache"] is True:                                           │
│ ❱  956 │   │   │   requests_cache.delete(expired=True)                                           │
│    957 │   │                                                                                     │
│    958 │   │   if not value_is_numeric(row["node_id"]):                                          │
│    959 │   │   │   row["node_id"] = get_nid_from_url_alias(config, row["node_id"])               │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: module 'requests_cache' has no attribute 'delete'
mjordan commented 1 week ago

Can you run pip freeze | grep requests-cache to see what version of requests_cache you have?

edlington commented 1 week ago

Thanks @mjordan !!! requests-cache==1.1.0

edlington commented 1 week ago

That's from output of pip freeze