Skip to content

Commit

Permalink
format and type hint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ischneider committed Nov 7, 2024
1 parent 8972317 commit 54758aa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
7 changes: 4 additions & 3 deletions planet/clients/subscriptions.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Planet Subscriptions API Python client."""

import logging
from typing import Any, AsyncIterator, Awaitable, Callable, Dict, Iterator, Optional, Sequence, TypeVar, Union, overload
from typing import Any, AsyncIterator, Awaitable, Dict, Iterator, Optional, Sequence, TypeVar, Union

from typing_extensions import Literal

Expand Down Expand Up @@ -381,6 +381,7 @@ def __init__(self,

def list_subscriptions(self,
status: Optional[Sequence[str]] = None,
source_type: Optional[str] = None,
limit: int = 100) -> Iterator[Dict]:
"""Iterate over list of account subscriptions with optional filtering.
Expand All @@ -405,7 +406,7 @@ def list_subscriptions(self,
ClientError: on a client error.
"""

results = self._client.list_subscriptions(status, limit)
results = self._client.list_subscriptions(status, source_type, limit)

try:
while True:
Expand Down Expand Up @@ -546,7 +547,7 @@ def get_results_csv(
"processing",
"failed",
"success"]]] = None
) -> AsyncIterator[str]:
) -> Iterator[str]:
"""Iterate over rows of results CSV for a Subscription.
Parameters:
Expand Down
17 changes: 9 additions & 8 deletions tests/integration/test_data_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
from planet import exceptions, DataClient, data_filter
from planet.clients.data import (LIST_SORT_DEFAULT,
LIST_SEARCH_TYPE_DEFAULT,
SEARCH_SORT_DEFAULT, DataAPI)
SEARCH_SORT_DEFAULT,
DataAPI)
from planet.http import Session

TEST_URL = 'http://www.mocknotrealurl.com/api/path'
Expand Down Expand Up @@ -442,8 +443,8 @@ def test_create_search_basic_sync(search_filter, data_api):
respx.post(TEST_SEARCHES_URL).return_value = mock_resp

search = data_api.create_search(item_types=['PSScene'],
search_filter=search_filter,
name='test')
search_filter=search_filter,
name='test')

# check that request is correct
expected_request = {
Expand Down Expand Up @@ -632,9 +633,9 @@ def test_update_search_basic_sync(search_filter, data_api):
f'{TEST_SEARCHES_URL}/{VALID_SEARCH_ID}').return_value = mock_resp

search = data_api.update_search(VALID_SEARCH_ID,
item_types=['PSScene'],
search_filter=search_filter,
name='test')
item_types=['PSScene'],
search_filter=search_filter,
name='test')

# check that request is correct
expected_request = {
Expand Down Expand Up @@ -1495,8 +1496,8 @@ async def _stream_img():
Path(tmpdir, 'img.tif').write_text('i exist')

path = data_api.download_asset(basic_udm2_asset,
directory=tmpdir,
overwrite=overwrite)
directory=tmpdir,
overwrite=overwrite)
assert path.name == 'img.tif'
assert path.is_file()

Expand Down

0 comments on commit 54758aa

Please sign in to comment.