Skip to content
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

Gzip request body if server support it #1476

Merged
merged 12 commits into from
Oct 9, 2023
Merged

Gzip request body if server support it #1476

merged 12 commits into from
Oct 9, 2023

Conversation

PatrykGala
Copy link
Contributor

@PatrykGala PatrykGala commented Sep 28, 2023

Before submitting checklist

  • Did you update the CHANGELOG? (not for test updates, internal changes/refactors or CI/CD setup)
  • Did you ask the docs owner to review all the user-facing changes?

@codecov
Copy link

codecov bot commented Sep 28, 2023

Codecov Report

Attention: 13 lines in your changes are missing coverage. Please review.

Files Coverage Δ
src/neptune/internal/backends/api_model.py 94.52% <100.00%> (-2.53%) ⬇️
src/neptune/internal/backends/hosted_client.py 84.61% <38.09%> (-13.98%) ⬇️

... and 112 files with indirect coverage changes

📢 Thoughts on this report? Let us know!.

@PatrykGala PatrykGala marked this pull request as ready for review September 28, 2023 09:49
@PatrykGala PatrykGala changed the title Pg gzip upload Gzip request body if server support it Sep 28, 2023
BartoszPrusak
BartoszPrusak previously approved these changes Sep 28, 2023
AleksanderWWW
AleksanderWWW previously approved these changes Oct 3, 2023
src/neptune/internal/backends/api_model.py Show resolved Hide resolved
src/neptune/internal/backends/hosted_client.py Outdated Show resolved Hide resolved
src/neptune/internal/backends/hosted_client.py Outdated Show resolved Hide resolved
def send(self, request, stream=False, **kw):
if request.body is not None and not stream:
request_body = request.body if isinstance(request.body, bytes) else bytes(request.body, "utf-8")
gzip_compress = zlib.compressobj(zlib.Z_DEFAULT_COMPRESSION, zlib.DEFLATED, zlib.MAX_WBITS | 16)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we try catch that wrt. to https://docs.python.org/3/library/zlib.html#zlib.error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it's necessary because an exception is very generic.

Copy link
Contributor

Choose a reason for hiding this comment

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

They mentioned that this could happen on compression as well

@PatrykGala
Copy link
Contributor Author

CHANGELOG.md Outdated Show resolved Hide resolved
src/neptune/internal/backends/hosted_client.py Outdated Show resolved Hide resolved
@PatrykGala PatrykGala merged commit 462afe5 into master Oct 9, 2023
4 checks passed
@PatrykGala PatrykGala deleted the pg_gzip-upload branch October 9, 2023 06:59
aniezurawski added a commit that referenced this pull request Oct 9, 2023
Raalsky pushed a commit that referenced this pull request Oct 9, 2023
PatrykGala added a commit that referenced this pull request Oct 10, 2023
PatrykGala added a commit that referenced this pull request Oct 10, 2023
Raalsky pushed a commit that referenced this pull request Oct 10, 2023
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.

4 participants