Skip to content

Commit 54758aa

Browse files
committed
format and type hint fixes
1 parent 8972317 commit 54758aa

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

planet/clients/subscriptions.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Planet Subscriptions API Python client."""
22

33
import logging
4-
from typing import Any, AsyncIterator, Awaitable, Callable, Dict, Iterator, Optional, Sequence, TypeVar, Union, overload
4+
from typing import Any, AsyncIterator, Awaitable, Dict, Iterator, Optional, Sequence, TypeVar, Union
55

66
from typing_extensions import Literal
77

@@ -381,6 +381,7 @@ def __init__(self,
381381

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

408-
results = self._client.list_subscriptions(status, limit)
409+
results = self._client.list_subscriptions(status, source_type, limit)
409410

410411
try:
411412
while True:
@@ -546,7 +547,7 @@ def get_results_csv(
546547
"processing",
547548
"failed",
548549
"success"]]] = None
549-
) -> AsyncIterator[str]:
550+
) -> Iterator[str]:
550551
"""Iterate over rows of results CSV for a Subscription.
551552
552553
Parameters:

tests/integration/test_data_api.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
from planet import exceptions, DataClient, data_filter
2828
from planet.clients.data import (LIST_SORT_DEFAULT,
2929
LIST_SEARCH_TYPE_DEFAULT,
30-
SEARCH_SORT_DEFAULT, DataAPI)
30+
SEARCH_SORT_DEFAULT,
31+
DataAPI)
3132
from planet.http import Session
3233

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

444445
search = data_api.create_search(item_types=['PSScene'],
445-
search_filter=search_filter,
446-
name='test')
446+
search_filter=search_filter,
447+
name='test')
447448

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

634635
search = data_api.update_search(VALID_SEARCH_ID,
635-
item_types=['PSScene'],
636-
search_filter=search_filter,
637-
name='test')
636+
item_types=['PSScene'],
637+
search_filter=search_filter,
638+
name='test')
638639

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

14971498
path = data_api.download_asset(basic_udm2_asset,
1498-
directory=tmpdir,
1499-
overwrite=overwrite)
1499+
directory=tmpdir,
1500+
overwrite=overwrite)
15001501
assert path.name == 'img.tif'
15011502
assert path.is_file()
15021503

0 commit comments

Comments
 (0)