Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(node): unable to 'add' to a table created from python #1289

Open
Tracked by #1251
universalmind303 opened this issue May 10, 2024 · 0 comments
Open
Tracked by #1251

bug(node): unable to 'add' to a table created from python #1289

universalmind303 opened this issue May 10, 2024 · 0 comments
Labels
bug Something isn't working typescript Typescript / javascript

Comments

@universalmind303
Copy link
Contributor

LanceDB version

min

What happened?

if you create a table in python, then try to add data to it from javascript, you get a vague error about table schemas throw new TypeError('Table and inner RecordBatch schemas must be equivalent.');

Are there known steps to reproduce?

create a table in python

import lancedb
from lancedb.pydantic import LanceModel, Vector
from lancedb.embeddings import get_registry
db = lancedb.connect("/tmp/lancedb")
func = get_registry().get("openai").create(name="text-embedding-ada-002")

class Words(LanceModel):
    text: str = func.SourceField()
    vector: Vector(func.ndims()) = func.VectorField()

table = db.create_table("words1", schema=Words, mode="overwrite")
table.add(
    [
        {"text": "hello world"},
        {"text": "goodbye world"}
    ]
)

try to add data to it from js

const db = await lancedb.connect("/tmp/lancedb");
const tbl = await db.openTable("words");
console.log(await tbl.schema)
const data = await tbl.add([
  {"text": "hello world"},
  {"text": "goodbye world"}
]);
@universalmind303 universalmind303 added bug Something isn't working typescript Typescript / javascript labels May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working typescript Typescript / javascript
Projects
None yet
Development

No branches or pull requests

1 participant