Skip to content

[CLIENT-2468] Simplify index creation API#505

Open
juliannguyen4 wants to merge 61 commits intodevfrom
CLIENT-2468-revamp-index-create-api
Open

[CLIENT-2468] Simplify index creation API#505
juliannguyen4 wants to merge 61 commits intodevfrom
CLIENT-2468-revamp-index-create-api

Conversation

@juliannguyen4
Copy link
Collaborator

@juliannguyen4 juliannguyen4 commented Sep 7, 2023

To make creating secondary indices with a list of contexts simpler:

  1. We consolidate all client.index_<index_datatype>_create() methods into one client.index_single_value_create() method that takes in a ctx parameter. As a result, these are now deprecated:
  • client.index_string_create()
  • client.index_blob_create()
  • client.index_integer_create()
  • client.index_geospatial_create()
  1. We also add a ctx parameter to client.index_map_keys_create(), client.index_map_values_create(), and client.index_list_create(). As a result, client.index_cdt_create() is now deprecated.

Implementation details

  • Consolidate argument parsing for both non-deprecated and deprecated index creation API's

Extra changes

  • Docs: client.index_list_create(), client.index_map_keys_create(), and client.index_map_values_create(): fix description
  • Add missing test cases that create an index targeting keys/values inside a nested list and map.

The following methods are now deprecated:

  • client.index_cdt_create()
  • client.index_integer_create()
  • client.index_blob_create()
  • client.index_string_create()
  • client.index_geo2dsphere_create()

Preview of updated docs

https://aerospike-python-client--505.org.readthedocs.build/en/505/client.html#index-operations
https://aerospike-python-client--505.org.readthedocs.build/en/505/aerospike.html#index-types

TODO

  • review approved changes from 2023
  • docstrings are missing return values don't document integer as return value, just assume it returns None since exception will be raised if an error occurs
  • test/misc don't update because not maintained
  • Added kwd tests for supported index creation methods
  • Build artifacts passes
  • Valgrind shows no memory errors or leaks from these changes
  • Massif usage looks ok

@juliannguyen4 juliannguyen4 force-pushed the CLIENT-2468-revamp-index-create-api branch from 4bb0d29 to b696c61 Compare September 7, 2023 19:57
@juliannguyen4 juliannguyen4 marked this pull request as ready for review September 7, 2023 20:49
@codecov-commenter
Copy link

codecov-commenter commented Sep 11, 2023

Codecov Report

❌ Patch coverage is 94.85294% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.53%. Comparing base (41af09e) to head (fbeb9d9).
⚠️ Report is 2 commits behind head on dev.

Files with missing lines Patch % Lines
src/main/client/sec_index.c 94.77% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #505      +/-   ##
==========================================
- Coverage   83.55%   83.53%   -0.02%     
==========================================
  Files          99       99              
  Lines       14438    14395      -43     
==========================================
- Hits        12063    12025      -38     
+ Misses       2375     2370       -5     

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

@juliannguyen4 juliannguyen4 changed the base branch from stage to dev January 27, 2026 00:13
@juliannguyen4 juliannguyen4 changed the title [CLIENT-2468] Revamp index creation api [CLIENT-2468] Revamp index creation API Jan 27, 2026
@juliannguyen4 juliannguyen4 changed the title [CLIENT-2468] Revamp index creation API [CLIENT-2468] Simplify index creation API Feb 4, 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.

2 participants