Skip to content
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

POST a feature collection to the items route #367

Merged
merged 13 commits into from
Apr 18, 2022

Conversation

jonhealy1
Copy link
Collaborator

@jonhealy1 jonhealy1 commented Mar 1, 2022

Related Issue(s):

Description:
Allow for the items route to accept a feature collection as well as a single item.

PR Checklist:

  • Code is formatted and linted (run pre-commit run --all-files)
  • Tests pass (run make test)
  • Documentation has been updated to reflect changes, if applicable, and docs build successfully (run make docs)
  • Changes are added to the CHANGELOG.

@philvarner
Copy link
Collaborator

needs a changelog entry.

bulk_client = BulkTransactionsClient(session=self.session)
return_msg = bulk_client.bulk_item_insert(items=model["features"])

return return_msg
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should return None per the signature.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm about to open another PR that will actually change that signature to be Optional[stac_types.Item], to advertise that None is a valid response

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok sounds good

@jonhealy1 jonhealy1 requested a review from philvarner March 26, 2022 11:18
@@ -35,11 +35,19 @@ class TransactionsClient(BaseTransactionsClient):
)

def create_item(
self, item: stac_types.Item, **kwargs
self, model: Union[stac_types.Item, stac_types.ItemCollection], **kwargs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated this to reflect the fact that the model is either Item or ItemCollection

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

Successfully merging this pull request may close these issues.

3 participants