[CLIENT-4836] Add support for string operations and expressions#1072
Draft
juliannguyen4 wants to merge 246 commits into
Draft
[CLIENT-4836] Add support for string operations and expressions#1072juliannguyen4 wants to merge 246 commits into
juliannguyen4 wants to merge 246 commits into
Conversation
Codecov Report❌ Patch coverage is 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. 🚀 New features to boost your workflow:
|
…a base64 encoded string
… creating it for each method
…-ops-and-expressions
…urs. Just copy type alias TypeCTX to string_operations.py so we don't need to have a import only for type hints
…Google-style doc example
…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
…rest of the string ops.
…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.
…level cls_value var has been made private.
…rospike_helpers.expressions.string
… 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.
…re will be ops with the same code
…eration dictionary to be consistent with the list operations' op dicts.
…or invalid types.
…ssion _fixed dictionary to address wrong arg ordering.
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.
aerospike_helpers.operations.operations.{append,prepend}with strings.Extra changes
Disable running tests with flags that convert
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
Docs