Skip to content

[EI-3347] Add support for binary download #11

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 2 commits into from
Sep 25, 2024
Merged

Conversation

andyantrim
Copy link

Issue
Currently we download all content as a string and store that string in the Data class. To prepare for additional file types, we should add support for binary downloads, without breaking existing usage.

Fix
Updated the data class

  • Added as_bytes function, that returns the bytes content
  • Added as_string function, which returns the string content of the file (as download did before)
  • Updated download function, it just calls as_string and is marked as depreciated, and to be removed in 0.2.0

@andyantrim andyantrim added the enhancement New feature or request label Sep 20, 2024
@andyantrim andyantrim changed the title Add support for binary download [EI-3347] Add support for binary download Sep 24, 2024

Returns:
The downloaded content as string or None, if the download fails.
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Add deprecation notice for docs:
(if this were to first appear in release 0.2.0, then)

        .. deprecated:: 0.2.0
            Use `as_string()` or `as_bytes()` instead

image

Copy link
Contributor

@vtermanis vtermanis left a comment

Choose a reason for hiding this comment

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

  1. Let's discuss what's best to do with the Data class tomorrow.
    • Your change is obviously in line with what already exists so this might be fine as-is but let's see what we want to do.
  2. CHANGELOG.md should be updated with bits added for unreleased updates (yes - I know I've also forgotten to do so) - or we remove the changelog (since it's pointed to from PyPI) and use another method. I thought it'd be better to use this file than GH releases since that would make it GH-specific.

Copy link
Contributor

@vtermanis vtermanis left a comment

Choose a reason for hiding this comment

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

LGTM.
All the feedback I have are minor things - consider at your discretion

@andyantrim andyantrim merged commit 7a79d43 into main Sep 25, 2024
1 check passed
@andyantrim andyantrim deleted the ab-download-binary branch September 25, 2024 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants