Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

SQLAlchemy backend bulk item insert fails #356

Closed
philvarner opened this issue Feb 24, 2022 · 1 comment
Closed

SQLAlchemy backend bulk item insert fails #356

philvarner opened this issue Feb 24, 2022 · 1 comment
Assignees

Comments

@philvarner
Copy link
Collaborator

philvarner commented Feb 24, 2022

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()]
@geospatial-jeff
Copy link
Collaborator

Closed with #358. BTW @philvarner I gave you write access as requested in that PR.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants