-
Notifications
You must be signed in to change notification settings - Fork 111
CLIENT-2383 - Fix bug where Query.where() and client.index_cdt_create() do not accept a list of contexts #550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
CLIENT-2383 Added support for context lists in Client.index_cdt_create() and Client.Query.where() Fixed the check for TestBaseClass.version not working corerctly upon initialization
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #550 +/- ##
==========================================
+ Coverage 83.37% 83.42% +0.04%
==========================================
Files 99 99
Lines 14389 14411 +22
==========================================
+ Hits 11997 12022 +25
+ Misses 2392 2389 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
juliannguyen4
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
query.where() is missing a test case.
src/main/conversions.c
Outdated
| PyObject *op_dict, bool *ctx_in_use, | ||
| as_static_pool *static_pool, int serializer_type) | ||
| { | ||
| PyObject *py_ctx = PyDict_GetItemString(op_dict, CTX_KEY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be better to modify Client.index_cdt_create() and Query.where() directly, instead of this helper function. Many other functions use this helper function, so this change might introduce a bug somewhere else in the client.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. I added these changes in the newest commit
| pass | ||
|
|
||
| if (TestBaseClass.major_ver, TestBaseClass.minor_ver) >= (7, 0): | ||
| if (int(TestBaseClass.major_ver), int(TestBaseClass.minor_ver)) >= (7, 0): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if (int(TestBaseClass.major_ver), int(TestBaseClass.minor_ver)) >= (7, 0): | |
| if (TestBaseClass.major_ver), TestBaseClass.minor_ver) >= (7, 0): |
Isn't TestBaseClass.major_ver and minor_ver already initialized here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was experiencing errors using the 7.0 server not creating the BLOB secondary indexes, and I used that debug code to test the value. The value for major_ver was printing 0. I'm not sure if it was a quirky local thing or something else, so we can remove this if needed. However, I don't think it harms anything, so I would suggest leaving it.
Added Documentation Added test cases for ctx dictionary legacy support
Ran precommit lint
Fixed memory leak in get_cdt_ctx
Fixed misuse of Py_Decref
* [CLIENT-3793] Remove macOS 13 support (#846) * Auto-bump version to 18.1.0rc3.dev1 [skip ci] * [CLIENT-3106] Remove dead code in conversions.c (#817) - record_to_resultpyobject() was a helper function for client.batch_get_ops(), which is now removed. - record_to_pyobject_cnvt_list_to_map() and as_list_of_map_to_py_tuple_list(): these were helper functions that were used before Python client version 2.1.3 to return the result of certain map operations. They are no longer used starting from Python client 2.1.3 and higher, so it is safe to remove - bin_strict_type_checking() isn't used anywhere. But it would be good to consolidate the bin checking code into one place, since it is currently spread out all over the codebase - as_batch_read_results_to_pyobject() was used by get_many() which has been removed - batch_read_records_to_pyobject() was used by select_many() which has been removed Extra Changes Merge do_*_to_pyobject() methods into their calling methods, since they have the same function signature * Auto-bump version to 18.1.0rc3.dev2 [skip ci] --------- Co-authored-by: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
NOTE: this does not fix this bug for list and map operations that accept a ctx parameter. A long term fix for all commands and operations that accept a ctx parameter is in this PR: #903
This approach does not make breaking changes to the helper function get_cdt_ctx(); it now takes in a ctx list and converts it to a dictionary containing the ctx list as a map value.
CLIENT-2383
Added support for context lists in Client.index_cdt_create() and Client.Query.where() Fixed the check for TestBaseClass.version not working corerctly upon initialization