Skip to content

Document and clean up subscriptions client limit behaviour #1071

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 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
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
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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had a Slack discussion and found that this arg is unused, undocumented and was never required. This theoretically could be a breaking change for somebody, but removing it seems reasonable

"success"]]] = None
) -> AsyncIterator[str]:
"""Iterate over rows of results CSV for a Subscription.

Expand Down
Loading