Skip to content
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

CLIENT-2383 - Context arguments must accept a context list #550

Open
wants to merge 4 commits into
base: stage
Choose a base branch
from

Conversation

DomPeliniAerospike
Copy link
Collaborator

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

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (ed45d73) 81.05% compared to head (2f83de6) 81.25%.
Report is 5 commits behind head on stage.

Files Patch % Lines
src/main/client/sec_index.c 77.77% 2 Missing ⚠️
src/main/query/where.c 81.81% 2 Missing ⚠️
src/main/conversions.c 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            stage     #550      +/-   ##
==========================================
+ Coverage   81.05%   81.25%   +0.19%     
==========================================
  Files          98       99       +1     
  Lines       14833    14915      +82     
==========================================
+ Hits        12023    12119      +96     
+ Misses       2810     2796      -14     

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

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.

@@ -2382,7 +2382,15 @@ as_status get_cdt_ctx(AerospikeClient *self, as_error *err, as_cdt_ctx *cdt_ctx,
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

@@ -120,7 +120,7 @@ def setup_class(cls):
except e.IndexFoundError:
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
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.

None yet

3 participants