Skip to content

Conversation

@taimo3810
Copy link

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)
  • Get the necessary approvals
  • Once the last commit on the PR has been approved, add the "ready to pull" label to the Pull Request

Note: do not merge your PR from GitHub. Adding the "ready to pull" label is the final step in the review process.
After approvals, the changes in your PR will be committed to the main branch and this PR will be closed.

Fixes #6222 🦕


Summary

PR #5954 introduced a regression where create_tree_ah_index() fails when leaf_node_embedding_count and leaf_nodes_to_search_percent are not specified, because algorithmConfig is set to None instead of {"treeAhConfig": {}}.

According to the official documentation, algorithmConfig is a required field.

Changes

Reverts the conditional logic in create_tree_ah_index() to always create a TreeAhConfig:

# Before (buggy - after PR #5954)
algorithm_config = None
if (
    leaf_node_embedding_count is not None
    or leaf_nodes_to_search_percent is not None
):
    algorithm_config = TreeAhConfig(...)

# After (fixed)
algorithm_config = TreeAhConfig(
    leaf_node_embedding_count=leaf_node_embedding_count,
    leaf_nodes_to_search_percent=leaf_nodes_to_search_percent,
)

Test

Updated test_create_tree_ah_index_empty_algorithm_config to expect {"treeAhConfig": {...}} instead of None.

All 66 tree-AH related tests pass.

@product-auto-label product-auto-label bot added the size: s Pull request size is small. label Jan 3, 2026
@google-cla
Copy link

google-cla bot commented Jan 3, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@product-auto-label product-auto-label bot added the api: vertex-ai Issues related to the googleapis/python-aiplatform API. label Jan 3, 2026
@taimo3810
Copy link
Author

taimo3810 commented Jan 3, 2026

[Sharing My Status] I have signed the CLA. Waiting for approval of my submission.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: vertex-ai Issues related to the googleapis/python-aiplatform API. size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: create_tree_ah_index() fails when leaf parameters are not specified (regression from PR #5954)

1 participant