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

Table name already exists #717

Open
ahuang11 opened this issue Oct 4, 2024 · 0 comments
Open

Table name already exists #717

ahuang11 opened this issue Oct 4, 2024 · 0 comments

Comments

@ahuang11
Copy link
Contributor

ahuang11 commented Oct 4, 2024

LLM generated table name could be duplicate of previous and when recreating the eph table, it crashes:

  File "/Users/ahuang/repos/lumen/lumen/ai/assistant.py", line 482, in invoke
    await agent.invoke(messages[-context_length:], **kwargs)
  File "/Users/ahuang/repos/lumen/lumen/ai/agents.py", line 738, in invoke
    sql_query = await self.answer(messages)
  File "/Users/ahuang/repos/lumen/lumen/ai/agents.py", line 734, in answer
    sql_query = await self._create_valid_sql(messages, system, tables_to_source)
  File "/Users/ahuang/repos/lumen/lumen/ai/utils.py", line 47, in async_wrapper
    output = await func(*args, **kwargs)
  File "/Users/ahuang/repos/lumen/lumen/ai/agents.py", line 606, in _create_valid_sql
    raise e
  File "/Users/ahuang/repos/lumen/lumen/ai/agents.py", line 580, in _create_valid_sql
    sql_expr_source = source.create_sql_expr_source({expr_slug: sql_query})
  File "/Users/ahuang/repos/lumen/lumen/sources/duckdb.py", line 232, in create_sql_expr_source
    raise e
  File "/Users/ahuang/repos/lumen/lumen/sources/duckdb.py", line 217, in create_sql_expr_source
    self._connection.execute(table_expr)
duckdb.duckdb.CatalogException: Catalog Error: Table with name "top_5_winter_olympic_games" already exists
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant