[CLIENT-4836] Add support for string operations and expressions - #1072
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## dev #1072 +/- ##
==========================================
+ Coverage 84.46% 84.97% +0.51%
==========================================
Files 99 102 +3
Lines 14090 14839 +749
==========================================
+ Hits 11901 12610 +709
- Misses 2189 2229 +40 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…s duplicate object description warnings
…e thing for the other classes.
…reasing numeric order) instead of the default alphabetical order
…ate the constructor's docstring
…ror suggests it needs to be
…o define set of _AS_STRING_OP* codes separate from the C client's AS_STRING_OP* codes. The _AS_STRING* codes need to be unique from the other op codes exposed via aerospike_helpers. Then use X macro to expose string op codes from aerospike module
…e type stubs don't show any constants with value 127, so I believe _AS_EXP_CODE_CALL is safe to expose for aerospike_helpers.expressions to use
…nding string ops.
…s for class defined in this module and not the imported classes.
…re it is defined.
|
|
TODO - only will run valgrind / massif but not build artifacts on server 8.1.3 since we don't have JFrog images yet. Merging this in ASAP to give QE a build with string ops |
…-ops-and-expressions
…ory leak (found in happy path test).
|
Memory leak no longer shows up on github actions (with server 8.1.2.x) But now getting these test failures. The failing dynamic config tests here use the send key policy, so I suspect the send key changes in C client commit f0e030590eb33f7182c04e35fa692edf2f1de530 are causing these failures |
6e69f26 to
0ac4e2e
Compare
…-ops-and-expressions
|
Currently all string write op tests are failing against latest server Waiting for Nate to respond today or Monday. Caught memory error at 0ac4e2e
Rerunning valgrind on send key PR & latest Valgrind here: https://github.com/aerospike/aerospike-client-python/actions/runs/28267287865/job/83757294667 Valgrind in C client change from |
…to align with PRD and be consistent with the other expressions.
…incorporating the send_key union changes in this PR, so need to cherrypick the test changes to here. Also use C client memory leak fix instead of the workaround in the python client code
|
Noticed that memory usage curve changed: |
…gative and happy path code paths together to prevent this from happening
02a75d5 to
4cf37d1
Compare
|
|
Culprit test - |
…ct heap allocated values passed to the Val expression, but need to confirm this
…stead of freeing every as_exp_entry that represents a value to prevent double free
|
|
aerospike_helpers.operations.operations.{append,prepend}with strings.Extra changes
DeprecationWarning's into errors. This is becauseaerospike_helpers.operations.operations.append()andaerospike_helpers.operations.operations.prepend()are deprecated but are still used throughout the test suite. We still to support these calls since the new string opsappend()andprepend()are only supported in server version >= 8.1.3. If we enable errors for DeprecationWarnings, all theoperations.append()/prepend()calls will fail out withClientError; we need these operations to succeed.TODO
Python docstrings in VS code are not formatted. So the placeholders still show up in type hinting. This problem may also exist with extended metrics / NodeStats in aerospike_helpers.There's no well known solution for this, so I replaced all the placeholders manually.Ops dictionaries now have extra variables we don't want (found via GDB). Need to omit those...only way is to filter outlocals()using dictionary comprehension, but this is O(n) time. Resolved by just returning a dictionary with only the argExpressions need to state return value type since they are strongly typedIgnoring since it makes the return description too long IMOCross reference for expressions to corresponding operations doesn't show up in IDE type hintsCross reference generated at runtime. This isn't a big deal since the online API docs will show the cross referencesRegression if deprecatingI'm guessing only for non-valid UTF-8 stringsCmpRegex?Test failures on server 8.1.3 with test_prepend.py, test_operate.py. I also tested with Python client'sFixed by changing server setup to support setting ttldevand also seeing test failuresOut of scope
add_expr_macros- wondering if a failing negative codepath can cause memory leaks due to returningerr->codeimmediately. Leaving this alone for now since this is an existing problem indevthat is out of scope for this PR.dev.Docs