Skip to content

SQLAlchemy backend bulk item insert fails  #356

Closed
@philvarner

Description

@philvarner

processed_items = [self._preprocess_item(item) for item in items]

I'm not sure what the error is going to be here, because I found this with some derived code that failed in an arbitrarily different way.

The problem is that items is an instance of Items, and using this in a list comprehension will iterate over the (string) keys in the items dict<string,Any> attribute of Items per it's implementation of iter, rather than each Item itself (the values of the dict) as this code expects.

I fixed this in my code with:

 processed_items = [self._preprocess_item(item, base_url) for item in items.items.values()]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions