Allow creation of an empty table (#254)

It's inconvenient to always require data at table creation time.
Here we enable you to create an empty table and add data and set schema
later.

---------

Co-authored-by: Chang She <chang@lancedb.com>
This commit is contained in:
Chang She
2023-07-06 20:44:58 -07:00
committed by GitHub
parent 507eeae9c8
commit e2325c634b
5 changed files with 61 additions and 21 deletions

View File

@@ -13,7 +13,7 @@
from __future__ import annotations
import asyncio
from typing import Literal
from typing import Literal, Union
import numpy as np
import pandas as pd
@@ -48,7 +48,7 @@ class LanceQueryBuilder:
def __init__(
self,
table: "lancedb.table.LanceTable",
query: np.ndarray,
query: Union[np.ndarray, str],
vector_column_name: str = VECTOR_COLUMN_NAME,
):
self._metric = "L2"