Skip to content

Allow item types specified to be case insensitive in Data API and CLI #902

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

Merged
merged 2 commits into from
Mar 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions planet/clients/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from ..constants import PLANET_BASE_URL
from ..http import Session
from ..models import Paged, StreamingBody
from ..specs import validate_item_type

BASE_URL = f'{PLANET_BASE_URL}/data/v1/'
SEARCHES_PATH = '/searches'
Expand Down Expand Up @@ -146,7 +147,7 @@ async def search(self,

search_filter = search_filter or empty_filter()

# TODO: validate item_types
item_types = [validate_item_type(item) for item in item_types]
request_json = {'filter': search_filter, 'item_types': item_types}
if name:
request_json['name'] = name
Expand Down Expand Up @@ -203,7 +204,7 @@ async def create_search(self,
"""
url = self._searches_url()

# TODO: validate item_types
item_types = [validate_item_type(item) for item in item_types]
request = {
'name': name,
'filter': search_filter,
Expand Down Expand Up @@ -236,6 +237,7 @@ async def update_search(self,
"""
url = f'{self._searches_url()}/{search_id}'

item_types = [validate_item_type(item) for item in item_types]
request = {
'name': name,
'filter': search_filter,
Expand Down Expand Up @@ -394,6 +396,7 @@ async def get_stats(self,

url = f'{self._base_url}{STATS_PATH}'

item_types = [validate_item_type(item) for item in item_types]
request = {
'interval': interval,
'filter': search_filter,
Expand Down