Skip to content

[CLIENT-4836] Add support for string operations and expressions#1072

Draft
juliannguyen4 wants to merge 246 commits into
devfrom
CLIENT-4836-add-string-ops-and-expressions
Draft

[CLIENT-4836] Add support for string operations and expressions#1072
juliannguyen4 wants to merge 246 commits into
devfrom
CLIENT-4836-add-string-ops-and-expressions

Conversation

@juliannguyen4

@juliannguyen4 juliannguyen4 commented May 20, 2026

Copy link
Copy Markdown
Collaborator
  • Deprecate using aerospike_helpers.operations.operations.{append,prepend} with strings.
  • Add cross references from string expressions to string operations since the latter has more detailed documentation about behavior.

Extra changes

Disable running tests with flags that convert DeprecationWarning's into errors. This is because aerospike_helpers.operations.operations.append() and aerospike_helpers.operations.operations.prepend() are deprecated but are still used throughout the test suite. We still to support these calls since the new string ops append() and prepend() are only supported in server version >= 8.1.3. If we enable errors for DeprecationWarnings, all the operations.append()/prepend() calls will fail out with ClientError; 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 out locals() using dictionary comprehension, but this is O(n) time. Resolved by just returning a dictionary with only the arg
  • Expressions need to state return value type since they are strongly typed Ignoring since it makes the return description too long IMO
  • Cross reference for expressions to corresponding operations doesn't show up in IDE type hints Cross reference generated at runtime. This isn't a big deal since the online API docs will show the cross references
  • Align with other clients re: snip. Make end argument required
  • Add copyright notices to all new files
  • Regression if deprecating CmpRegex? I'm guessing only for non-valid UTF-8 strings
  • Test failures on server 8.1.3 with test_prepend.py, test_operate.py. I also tested with Python client's dev and also seeing test failures Fixed by changing server setup to support setting ttl

Out of scope

  • Find way to automate copyright notices

Docs

@codecov-commenter

codecov-commenter commented May 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.60526% with 41 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.98%. Comparing base (90a0873) to head (ef26a49).

Files with missing lines Patch % Lines
src/main/convert_expressions.c 92.42% 15 Missing ⚠️
src/main/client/list_and_string_operate.c 94.73% 10 Missing ⚠️
src/main/client/cdt_operation_utils.c 66.66% 8 Missing ⚠️
src/main/conversions.c 77.77% 4 Missing ⚠️
src/main/client/operate.c 81.81% 2 Missing ⚠️
aerospike_helpers/expressions/string.py 99.54% 1 Missing ⚠️
aerospike_helpers/operations/string_operations.py 98.76% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1072      +/-   ##
==========================================
+ Coverage   84.46%   84.98%   +0.51%     
==========================================
  Files          99      102       +3     
  Lines       14090    14836     +746     
==========================================
+ Hits        11901    12608     +707     
- Misses       2189     2228      +39     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…urs. Just copy type alias TypeCTX to string_operations.py so we don't need to have a import only for type hints
…reasing numeric order) instead of the default alphabetical order
…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
…he function signature already has the types.
…nd() ops in the next major client release, since it's not guaranteed that release will happen at the same time we drop server < 8.1.3 support
…ouble check where _WriteOp cross reference is, bc my doc source code doesn't have a reference to it.
… only included for API symmetry / futureproofing the API.
…ow that we decided not to use string_operations.append/prepend as a drop in replacement for the original operations.append/prepend()
…an defer that to later once product team makes a final decision.
…eration dictionary to be consistent with the list operations' op dicts.
…ssion _fixed dictionary to address wrong arg ordering.
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.

2 participants