Skip to content

Commit 20e4ff9

Browse files
committed
lint
1 parent 01ff5f4 commit 20e4ff9

File tree

7 files changed

+23
-26
lines changed

7 files changed

+23
-26
lines changed

planet/cli/orders.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ def orders(ctx, base_url):
137137
help="Filter by orders created with the provided destination reference.")
138138
@click.option(
139139
'--user-id',
140-
help="Filter by user ID. Only available to organization admins. Accepts 'all' or a specific user ID.")
140+
help=
141+
"Filter by user ID. Only available to organization admins. Accepts 'all' or a specific user ID."
142+
)
141143
@limit
142144
@pretty
143145
async def list(ctx,

planet/cli/subscriptions.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ def subscriptions(ctx, base_url):
112112
)
113113
@click.option(
114114
'--user-id',
115-
help="Filter by user ID. Only available to organization admins. Accepts 'all' or a specific user ID.")
115+
help=
116+
"Filter by user ID. Only available to organization admins. Accepts 'all' or a specific user ID."
117+
)
116118
@limit
117119
@click.option('--page-size',
118120
type=click.INT,

planet/clients/orders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ async def list_orders(
551551
if destination_ref is not None:
552552
params["destination_ref"] = destination_ref
553553
if user_id is not None:
554-
params["user_id"] = user_id
554+
params["user_id"] = str(user_id)
555555
if state:
556556
if state not in ORDER_STATE_SEQUENCE:
557557
raise exceptions.ClientError(

planet/sync/orders.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -252,18 +252,19 @@ def wait(self,
252252
return self._client._call_sync(
253253
self._client.wait(order_id, state, delay, max_attempts, callback))
254254

255-
def list_orders(self,
256-
state: Optional[str] = None,
257-
limit: int = 100,
258-
source_type: Optional[str] = None,
259-
name: Optional[str] = None,
260-
name__contains: Optional[str] = None,
261-
created_on: Optional[str] = None,
262-
last_modified: Optional[str] = None,
263-
hosting: Optional[bool] = None,
264-
destination_ref: Optional[str] = None,
265-
sort_by: Optional[str] = None,
266-
user_id: Optional[Union[str, int]] = None) -> Iterator[dict]:
255+
def list_orders(
256+
self,
257+
state: Optional[str] = None,
258+
limit: int = 100,
259+
source_type: Optional[str] = None,
260+
name: Optional[str] = None,
261+
name__contains: Optional[str] = None,
262+
created_on: Optional[str] = None,
263+
last_modified: Optional[str] = None,
264+
hosting: Optional[bool] = None,
265+
destination_ref: Optional[str] = None,
266+
sort_by: Optional[str] = None,
267+
user_id: Optional[Union[str, int]] = None) -> Iterator[dict]:
267268
"""Iterate over the list of stored orders.
268269
269270
By default, order descriptions are sorted by creation date with the last created

tests/integration/test_orders_api.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,7 @@ async def test_list_orders_user_id_filtering(order_descriptions, session):
191191

192192
# if the value of user_id doesn't get sent as a url parameter,
193193
# the mock will fail and this test will fail
194-
assert [order1, order2] == [
195-
o async for o in cl.list_orders(user_id='all')
196-
]
194+
assert [order1, order2] == [o async for o in cl.list_orders(user_id='all')]
197195

198196

199197
@respx.mock

tests/integration/test_orders_cli.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,7 @@ def test_cli_orders_list_user_id(invoke, order_descriptions):
138138

139139
# if the value of user_id doesn't get sent as a url parameter,
140140
# the mock will fail and this test will fail
141-
result = invoke([
142-
'list',
143-
'--user-id',
144-
'all'
145-
])
141+
result = invoke(['list', '--user-id', 'all'])
146142
assert result.exit_code == 0
147143
sequence = '\n'.join([json.dumps(o) for o in [order1, order2]])
148144
assert result.output == sequence + '\n'

tests/integration/test_subscriptions_cli.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@ def _invoke(extra_args, runner=None, **kwargs):
7272
'--hosting=true',
7373
'--sort-by=name DESC'
7474
],
75-
2),
76-
(['--user-id=all'], 100),
77-
(['--user-id=12345'], 100)])
75+
2), (['--user-id=all'], 100), (['--user-id=12345'], 100)])
7876
@api_mock
7977
# Remember, parameters come before fixtures in the function definition.
8078
def test_subscriptions_list_options(invoke, options, expected_count):

0 commit comments

Comments
 (0)