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(python): table.merge_insert does not accept a list of columns #1303

Open
lukebuehler opened this issue May 14, 2024 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@lukebuehler
Copy link

lukebuehler commented May 14, 2024

LanceDB version

0.6.13

What happened?

When using merge_insert with multiple columns, then there is an error:

table.merge_insert(["a", "b"])
  .when_matched_update_all()
  .when_not_matched_insert_all()
  .execute(insert_items)

Error:

File "/home/user/.cache/pypoetry/virtualenvs/p-MOM2VVIT-py3.10/lib/python3.10/site-packages/lancedb/table.py", line 485, in merge_insert
    on = [on] if isinstance(on, str) else list(on.iter())
AttributeError: 'list' object has no attribute 'iter'

I think thatt line should be ... else list(iter(on))

This issue exists both in the sync and async table.

Are there known steps to reproduce?

No response

@lukebuehler lukebuehler added the bug Something isn't working label May 14, 2024
@lukebuehler
Copy link
Author

lukebuehler commented May 14, 2024

For now, a workaround is:

merge_builder = LanceMergeInsertBuilder(table, on=["a", "b"])
            (merge_builder
                .when_matched_update_all()
                .when_not_matched_insert_all()
                .execute(insert_items))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants