-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Morgan Gallant <[email protected]>
- Loading branch information
1 parent
a63d8fe
commit f83dae4
Showing
2 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import turbopuffer as tpuf | ||
import tests | ||
|
||
def test_schema(): | ||
ns = tpuf.Namespace(tests.test_prefix + "schema") | ||
|
||
# Upsert some data | ||
ns.upsert([ | ||
{'id': 2, 'vector': [2, 2]}, | ||
{'id': 7, 'vector': [0.7, 0.7], 'attributes': {'hello': 'world', 'test': 'rows'}}, | ||
], distance_metric='euclidean_squared') | ||
|
||
# Get the schema for the namespace | ||
schema = ns.schema() | ||
for attr in ['hello', 'test']: | ||
assert schema.get(attr).type == "OptString" | ||
assert schema.get(attr).filterable | ||
assert schema.get(attr).bm25 is None | ||
|
||
# todo patch schema | ||
|
This file contains 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