Repository navigation
native: drop_type() drops populated graph types; a held VectorIndex re-reads after a drop - #166
Merged
Merged
Conversation
…e-reads after a drop (#164, #165) Two native/JVM differences found by an audit of the native code paths after #162: - drop_type ran SQL DROP TYPE, which refuses a vertex or edge type that holds records; the JVM build calls LocalSchema.dropType, which drops it, as the docstring says. The native call now runs DROP TYPE ... UNSAFE. - get_size(), get_metadata() and get_quantization() of a held native VectorIndex answered after DROP INDEX (a SQL row count, a memoized engine_info). They now re-read the metadata first, as get_stats() did: a dropped index raises with its name, a re-created one reports its own configuration. Shared tests: drop of a populated vertex and edge type; every read of a dropped index raises; a re-created index with quantization NONE is reported as NONE. Against the pre-fix 26.11.1.dev0 wheels the native wheel fails all four, the JVM wheel passes all four. Closes #164 Closes #165 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tae898
added a commit
that referenced
this pull request
Nov 1, 2026
…after DROP INDEX (#186) (#187) The query-vector list bullet said a float64 array crosses as one buffer on the JVM build with no value change; since #176 a positional float64 array is narrowed to float32 on both builds (the next bullet). The vectors page now says what #166 made true on both builds: held index reads ask the engine, raise with the index name after DROP INDEX, and report a re-created index's own configuration. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #164
Closes #165
Two native/JVM differences found by an audit of the native code paths after #162. Both fixes are Python-only.
drop_type()(native: drop_type() refuses a vertex or edge type that holds records #164): the native build ran SQLDROP TYPE, which refuses a vertex or edge type that still holds records; the JVM build callsLocalSchema.dropType(), which drops it, as the docstring says ("Drop a type and all its data"). The native call now runsDROP TYPE ... UNSAFE, which is what the engine call does.VectorIndexafterDROP INDEX(native: a held VectorIndex answers get_size(), get_metadata() and get_quantization() after DROP INDEX #165): nativeget_size()answered with a SQL row count, andget_metadata()/get_quantization()from a memoizedengine_info(). They now re-read the engine's metadata first, asget_stats()already did (a new_live_info()helper thatget_stats()shares): a dropped index raises with its name, as on the JVM build, and a re-created index reports its own configuration.Tests (shared, both builds):
tests/test_schema.py::TestTypeDeletion::test_drop_type_drops_a_populated_graph_type[vertex|edge]tests/test_vector_index_introspection.py::TestWrapperAcrossRebuildAndDrop::test_dropped_index_raises_and_never_answers_empty: all four reads now checked on both builds (the native ones were inside anif __backend__ == "jvm"before)....::test_a_recreated_index_reports_its_own_configuration: drop, re-create withquantization="NONE", the held wrapper reportsNONE.Verification: against the pre-fix 26.11.1.dev0 wheels on Linux x86-64 the native wheel fails all four new tests (
DROP TYPE"contains Vertices" / "contains Edges",DID NOT RAISEon the dropped index,'INT8' == 'NONE'on the re-created one) and the JVM wheel passes all four. black, isort, bandit clean. The fixed native build is tested by this PR'stest-native.ymlrun.🤖 Generated with Claude Code