fix(clickhouse): Don't eat the generator data#4669
Merged
szokeasaurusrex merged 2 commits intoAug 7, 2025
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4669 +/- ##
==========================================
+ Coverage 85.09% 85.11% +0.02%
==========================================
Files 156 156
Lines 15797 15803 +6
Branches 2671 2673 +2
==========================================
+ Hits 13442 13451 +9
+ Misses 1578 1577 -1
+ Partials 777 775 -2
|
3e3bd5e to
e38354b
Compare
Explicitly list the `send_data` parameters in the wrapped function. The parameters are coming from [here](https://github.com/mymarilyn/clickhouse-driver/blob/8a4e7c5b99b532df2b015651d893a6f36288a22c/clickhouse_driver/client.py#L634). Continue also providing `*args` and `**kwargs`, but only for forwards-compatibility. Also, don't take the `send_data` function as a parameter in the wrap function, rather just use it directly.
f76b786 to
b0ae2d9
Compare
Currently, the Clickhouse integration consumes any data passed as a generator when reading it for insertion as `db_params`. Instead, since generators cannot be cloned, we need to wrap the generator to add the params as we iterate over it. Fixes #4657
e38354b to
d9ee8c8
Compare
antonpirker
approved these changes
Aug 7, 2025
Contributor
antonpirker
left a comment
There was a problem hiding this comment.
Nice! Thanks for the fix!
Base automatically changed from
szokeasaurusrex/clickhouse-send_data-params
to
master
August 7, 2025 15:37
sentrivana
pushed a commit
that referenced
this pull request
Aug 12, 2025
Currently, the Clickhouse integration consumes any data passed as a generator when reading it for insertion as `db_params`. Instead, since generators cannot be cloned, we need to wrap the generator to add the params as we iterate over it. Fixes #4657 <!-- Describe your PR here --> --- Thank you for contributing to `sentry-python`! Please add tests to validate your changes, and lint your code using `tox -e linters`. Running the test suite on your PR might require maintainer approval.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, the Clickhouse integration consumes any data passed as a generator when reading it for insertion as
db_params. Instead, since generators cannot be cloned, we need to wrap the generator to add the params as we iterate over it.Fixes #4657
Thank you for contributing to
sentry-python! Please add tests to validate your changes, and lint your code usingtox -e linters.Running the test suite on your PR might require maintainer approval.