Skip to content

Conversation

@DomPeliniAerospike
Copy link
Collaborator

@DomPeliniAerospike DomPeliniAerospike commented Jan 8, 2024

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

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-commenter
Copy link

codecov-commenter commented Jan 8, 2024

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.42%. Comparing base (6739ae7) to head (01bb57f).
⚠️ Report is 3 commits behind head on dev.

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.
📢 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.

Copy link
Collaborator

@juliannguyen4 juliannguyen4 left a 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.

PyObject *op_dict, bool *ctx_in_use,
as_static_pool *static_pool, int serializer_type)
{
PyObject *py_ctx = PyDict_GetItemString(op_dict, CTX_KEY);
Copy link
Collaborator

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.

Copy link
Collaborator Author

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):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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?

https://github.com/aerospike/aerospike-client-python/blob/CLIENT-2383/test/new_tests/conftest.py#L174-L175

Copy link
Collaborator Author

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
@DomPeliniAerospike DomPeliniAerospike changed the title CLIENT-2383 CLIENT-2383 - Context arguments must accept a context list Feb 5, 2024
@DomPeliniAerospike DomPeliniAerospike changed the base branch from stage to dev November 14, 2025 14:12
DomPeliniAerospike and others added 14 commits November 14, 2025 07:26
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>
@juliannguyen4 juliannguyen4 changed the title CLIENT-2383 - Context arguments must accept a context list CLIENT-2383 - Fix bug where Query.where(), client.index_cdt_create() and other operations do not accept a list of contexts Jan 2, 2026
@juliannguyen4 juliannguyen4 changed the title CLIENT-2383 - Fix bug where Query.where(), client.index_cdt_create() and other operations do not accept a list of contexts CLIENT-2383 - Fix bug where Query.where() and client.index_cdt_create() do not accept a list of contexts Jan 2, 2026
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.

4 participants