-
Notifications
You must be signed in to change notification settings - Fork 93
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
WIP Features client #1073
base: main
Are you sure you want to change the base?
WIP Features client #1073
Conversation
…es, create_features
def _next_link(self, page): | ||
next_link = False | ||
|
||
#TODO: Build this into Paged.__next_link directly, other (unimplemented) APIs have a similar page structure |
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.
#TODO: Build this into Paged.__next_link directly, other (unimplemented) APIs have a similar page structure | |
# TODO: Build this into Paged.__next_link directly, other (unimplemented) APIs have a similar page structure |
LOGGER.debug('end of the pages') | ||
return next_link | ||
|
||
params = {} |
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.
params = {} | |
params: list[str, Any] = {} |
This is failing the mypy check since we're adding multiple types into this dict.
property_id: Optional[str] = None) -> AsyncIterator[str]: | ||
|
||
url = f'{self._base_url}/collections/{collection_id}/items' | ||
params = {} |
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.
params = {} | |
params: dict[str, Any] = {} |
"""Planet Features API Python client.""" | ||
|
||
import logging | ||
from typing import AsyncIterator, Optional, Iterator |
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.
from typing import AsyncIterator, Optional, Iterator | |
from typing import Any, AsyncIterator, Optional |
I added some minor suggestions for the type errors. Just remembered your request for somebody picking this up so no need to follow up. Looks like the biggest piece remaining is some test coverage. Maybe one of us can tackle that during one of the working session time blocks. |
Thanks for taking a look. Test coverage is definitely a big missing piece. CLI integration would be the other major part that's lacking, since this realy only covers the SDK part right now. There's also a number of other Features API endpoints to implement - so far this covers all the major ones, but not any of the less-used ones (e.g. "alternates" or "validate") |
Includes: list_collections, create_collection, list_features, create_features
This came out of an internal need for a project I was working on incorporating the SDK, and represents about the extent of time I have to contribute to Features API support at this time. If someone else can pick up from where this started, that would be great.
I have programmatically and manually tested all of the the FeaturesClient methods in the context of the project described above, and everything seems to be working. In particular, the API has different pagination scheme, currently handled by overriding Paged.__next_link, that could perhaps be incorporated directly into Paged, since the as-of-yet-unimplemented Analytics API uses the same pagination scheme.
Related Issue(s):
Oddly enough, we do not seem to have an issue for Features API support yet.
Proposed Changes:
For inclusion in changelog (if applicable):
PR Checklist: