Skip to content

Commit

Permalink
Document and clean up subscriptions client limit behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
tbarsballe committed Oct 24, 2024
1 parent 921a2ba commit 0960130
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions planet/cli/subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ async def get_subscription_cmd(ctx, subscription_id, pretty):
'csv_flag',
is_flag=True,
default=False,
help="Get subscription results as comma-separated fields.")
help="Get subscription results as comma-separated fields. When "
"this flag is included, --limit is ignored")
@limit
# TODO: the following 3 options.
# –created: timestamp instant or range.
Expand Down Expand Up @@ -254,8 +255,7 @@ async def list_subscription_results_cmd(ctx,
async with subscriptions_client(ctx) as client:
if csv_flag:
async for result in client.get_results_csv(subscription_id,
status=status,
limit=limit):
status=status):
click.echo(result)
else:
async for result in client.get_results(subscription_id,
Expand Down
7 changes: 3 additions & 4 deletions planet/clients/subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ async def list_subscriptions(self,
set, filter out subscriptions with status not in this
set.
limit (int): limit the number of subscriptions in the
results.
results. When set to 0, no maximum is applied.
TODO: user_id
Yields:
Expand Down Expand Up @@ -270,7 +270,7 @@ async def get_results(self,
status (Set[str]): pass result with status in this set,
filter out results with status not in this set.
limit (int): limit the number of subscriptions in the
results.
results. When set to 0, no maximum is applied.
TODO: created, updated, completed, user_id
Yields:
Expand Down Expand Up @@ -310,8 +310,7 @@ async def get_results_csv(
"queued",
"processing",
"failed",
"success"]]] = None,
limit: int = 100,
"success"]]] = None
) -> AsyncIterator[str]:
"""Iterate over rows of results CSV for a Subscription.
Expand Down

0 comments on commit 0960130

Please sign in to comment.