-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix sqlalchemy bulk item insertion #358
fix sqlalchemy bulk item insertion #358
Conversation
@@ -12,13 +12,13 @@ | |||
|
|||
|
|||
class Items(BaseModel): | |||
"""A list of STAC items.""" | |||
"""A group of STAC Item objects, in the form of a dictionary from Item.id -> Item.""" | |||
|
|||
items: Dict[str, Any] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't followed all the discussion but do we need it as a dict? Or could we just have a list of stac items?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a list of items would align better with ItemCollection
. But I believe the intent of this PR is to fix the current implementation not change how it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, I just wanted to fix the behavior rather than change the expected input
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing the extension, let's open another issue if we want to switch this to ItemCollection
as discussed in the linked issues.
Created an issue here: #362 |
e6a62d5
to
ebc6967
Compare
ebc6967
to
d5f3d64
Compare
@geospatial-jeff looks like you'll need to merge, I don't have write perms. |
@geospatial-jeff I resolved the merge conflict. I don't have write permission to merge it (which I would gladly accept if you want to grant me it) |
Related Issue(s):
Description:
SQLAlchemy bulk item insertion failed because the
Items
iterator returns the keys for the dict it contains, rather than the Item objects themselves as it's docstring says it should (and that it would make sense to).This fixes that problem, and documents what the format of the JSON object that is the input to the bulk insert endpoint is.
PR Checklist:
pre-commit run --all-files
)make test
)make docs
)