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] [Module Name] Bug title dbgpt.app.openapi.api_v1.editor.api_editor_v1.editor_chart_run 286line error #2345

Open
2 of 15 tasks
465366128 opened this issue Feb 11, 2025 · 0 comments
Labels
bug Something isn't working Waiting for reply

Comments

@465366128
Copy link

Search before asking

  • I had searched in the issues and found no similar issues.

Operating system information

MacOS(M1, M2...)

Python version information

3.10

DB-GPT version

main

Related scenes

  • Chat Data
  • Chat Excel
  • Chat DB
  • Chat Knowledge
  • Model Management
  • Dashboard
  • Plugins

Installation Information

Device information

Device CPU

Models information

LLM:通义千问

What happened

Image查询报错

What you expected to happen

timeout参数未定义错误

How to reproduce

dashboard -> Editor ->run

Additional context

dbgpt.datasource.rdbms.base.RDBMSConnector.query_ex 增加timeout入参,并修改如下

def query_ex(self, query: str, fetch: str = "all",timeout: Optional[int] = None):
"""Execute a SQL command and return the results.

    Only for query command.

    Args:
        query (str): SQL query to run
        fetch (str): fetch type

    Returns:
        List: result list
    """
    logger.info(f"Query[{query}]")
    if not query:
        return [], None
    with self.session.connection() as connection:
        if timeout is not None:
            connection.execution_options(timeout=timeout)
        # cursor = self.session.execute(text(query))
        cursor = connection.execute(text(query))
        if cursor.returns_rows:
            if fetch == "all":
                result = cursor.fetchall()
            elif fetch == "one":
                result = cursor.fetchone()  # type: ignore
            else:
                raise ValueError("Fetch parameter must be either 'one' or 'all'")
            field_names = list(cursor.keys())

            result = list(result)
            return field_names, result
    return [], None

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@465366128 465366128 added bug Something isn't working Waiting for reply labels Feb 11, 2025
@Aries-ckt Aries-ckt changed the title [Bug] [Module Name] Bug title dbgpt.app.openapi.api_v1.editor.api_editor_v1.editor_chart_run 286行报错 [Bug] [Module Name] Bug title dbgpt.app.openapi.api_v1.editor.api_editor_v1.editor_chart_run 286line error Feb 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Waiting for reply
Projects
None yet
Development

No branches or pull requests

1 participant