[CLIENT-2479]: bump c client, add tests and docs - #1201
Open
diparthaspike wants to merge 4 commits into
Open
Conversation
…n an error if both write operations and a record UDF are added to a background query/scan.
…sive Query/Scan execute_background() now raises ParamError (via the C client fix) if both a UDF (apply()) and write operations (add_ops()) have been set on the same object. Document this at apply(), add_ops(), and execute_background() for both Query and Scan, plus in query.rst's Query Aggregations overview section.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #1201 +/- ##
=======================================
Coverage 85.64% 85.64%
=======================================
Files 102 102
Lines 14888 14888
=======================================
Hits 12751 12751
Misses 2137 2137 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
|
||
| with pytest.raises(exception.ParamError) as excinfo: | ||
| query.execute_background() | ||
| assert excinfo.value.msg == "Cannot combine query operations with aggregation" |
Collaborator
There was a problem hiding this comment.
nit: I think "aggregation" should be replaced with "UDF" since stream UDF's are supposed to be performed using foreground queries. But since this error message is on the C client side, we can address this later
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.
Fixes: https://aerospike.atlassian.net/browse/CLIENT-2479
CLIENT-2479 Disallow use of add_ops() and apply() combined in a background scan/query
Summary
Combining regular write operations (add_ops()) and a UDF (apply()) on the same Scan/Query object before calling execute_background() previously executed silently, applying only one of the two effects instead of raising an error — a data-correctness bug, not just a missing validation message.
Root cause and fix location
The actual bug was in the underlying C client, not this Python extension:
Rather than patching this independently in the Python extension (which would need to be duplicated in every other language client built on aerospike-client-c, e.g. Node.js), the fix was made upstream in the C client:
This PR bumps the aerospike-client-c submodule to pick up that fix (commit 8025c2a0), and updates this repo's tests/docs to match.
Changes
Test plan