Skip to content

Conversation

@sgillies
Copy link
Contributor

@sgillies sgillies commented Jul 11, 2023

Resolves #933. The big choice here is to make CSV format access its own method instead of a flag on the existing method. I feel like this is warranted by the API split between JSON (paged) and CSV (not paged).

Sanity check @kevinlacaille @cpaulik ?

# retry logic for HTTP requests, but does not handle errors
# during streaming. We may want to consider a retry decorator
# for this entire method a la stamina:
# https://github.com/hynek/stamina.
Copy link
Contributor Author

@sgillies sgillies Jul 11, 2023

Choose a reason for hiding this comment

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

I think that our model for retrying requests doesn't cover streaming cases.

Retrying can wait until after 2.1.0.

@cpaulik
Copy link

cpaulik commented Jul 11, 2023

Thanks. Using this via planet subscriptions results UUID --csv makes sense to me.

Are we clear in the documentation about how to get the output into a CSV file? I think we have users for which that might not be obvious.

@guyon-planet guyon-planet merged commit ae1aa2c into main Jul 11, 2023
async with Session() as session:
client = SubscriptionsClient(session, base_url=TEST_URL)
results = [res async for res in client.get_results_csv("42")]
import csv
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm surprised yapf doesn't care about this import's placement.

@sgillies
Copy link
Contributor Author

@guyon-planet in the future, let me merge these. I have a couple changes to make yet.

@sgillies sgillies mentioned this pull request Jul 11, 2023
@guyon-planet
Copy link
Contributor

@sgillies, sorry about that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for upcoming csv timeseries subscription results

5 participants