Skip to content

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_<type>_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

  • Removed createIndexWithCollectionType() helper that was used by client.index_list_create(), client.index_map_keys_create(), and client.index_map_values_create() with a new helper create_index_with_known_index_type. The latter is an improvement because it handles the argument parsing for all of those API calls, as well as the new client.index_single_value_create().
  • Move context conversion code into createIndexWithDataAndCollectionType() since both create_index_with_known_index_type() and client.index_cdt_create() call that helper to create an index.

Extra changes

  • Fix get_int_from_py_int() assigning PyLong_AsLong()'s return value directly to an integer variable. Assigning a long value to an integer variable is undefined behavior if the long value exceeds the integer type's min/max bounds.

6cc6ff6
…rectly to an integer variable

Docs

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

TODO

  • review approved changes from 2023
  • docstrings are missing return values

@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 81.29496% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.18%. Comparing base (41af09e) to head (6cc6ff6).
⚠️ Report is 2 commits behind head on dev.

Files with missing lines Patch % Lines
src/main/client/sec_index.c 81.02% 26 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #505      +/-   ##
==========================================
- Coverage   83.55%   82.18%   -1.37%     
==========================================
  Files          99       99              
  Lines       14438    14416      -22     
==========================================
- Hits        12063    11848     -215     
- Misses       2375     2568     +193     

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

3 participants