sqlalchemy.exc.InternalError 问题处理

本文介绍了解决SQLAlchemy中出现的InternalError问题,即因MySQL 5.7.5及更高版本默认启用only_full_group_by导致的Group By查询错误。通过修改MySQL配置文件中的sql_mode设置来禁用only_full_group_by,可以解决此问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

sqlalchemy.exc.InternalError 问题处理

错误提示:
sqlalchemy.exc.InternalError: (cymysql.err.InternalError) (1055, "Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column

问题原因:
mysql5.7.5之后sql_mode默认值是"only_full_group_by",不能执行group_by查询

问题解决:
windows版本: 在mysql 安装目录下找到 mysql配置文件 my.ini 在配置文件的最后一行加上如下配置

sql-mode="STRICT_ALL_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ZERO_DATE,NO_ZERO_IN_DATE,NO_AUTO_CREATE_USER"

Ubuntu版本: 找到mysql配置文件 一般的配置目录是

/etc/mysql/mysql.conf.d/mysqld.cnf

操作流程

sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf

加上配置

sql-mode="STRICT_ALL_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ZERO_DATE,NO_ZERO_IN_DATE,NO_AUTO_CREATE_USER"

在这里插入图片描述

这是什么错误 OR: Exception in ASGI application + Exception Group Traceback (most recent call last): | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/_utils.py", line 76, in collapse_excgroups | yield | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 186, in __call__ | async with anyio.create_task_group() as task_group: | ^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 763, in __aexit__ | raise BaseExceptionGroup( | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) +-+---------------- 1 ---------------- | Traceback (most recent call last): | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/httptools_impl.py", line 409, in run_asgi | result = await app( # type: ignore[func-returns-value] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__ | return await self.app(scope, receive, send) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__ | await super().__call__(scope, receive, send) | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/applications.py", line 113, in __call__ | await self.middleware_stack(scope, receive, send) | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 187, in __call__ | raise exc | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 165, in __call__ | await self.app(scope, receive, _send) | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/middleware/cors.py", line 85, in __call__ | await self.app(scope, receive, send) | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 185, in __call__ | with collapse_excgroups(): | ^^^^^^^^^^^^^^^^^^^^ | File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/contextlib.py", line 158, in __exit__ | self.gen.throw(value) | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/_utils.py", line 82, in collapse_excgroups | raise exc | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 187, in __call__ | response = await self.dispatch_func(request, call_next) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/06.renwu/00.fix_bug/test-automation-platform-backend/src/app/middlewares/request_logger_middleware.py", line 17, in dispatch | response = await call_next(request) | ^^^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 163, in call_next | raise app_exc | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 149, in coro | await self.app(scope, receive_or_disconnect, send_no_error) | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 62, in __call__ | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app | raise exc | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app | await app(scope, receive, sender) | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/routing.py", line 715, in __call__ | await self.middleware_stack(scope, receive, send) | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/routing.py", line 735, in app | await route.handle(scope, receive, send) | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/routing.py", line 288, in handle | await self.app(scope, receive, send) | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/routing.py", line 76, in app | await wrap_app_handling_exceptions(app, request)(scope, receive, send) | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app | raise exc | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app | await app(scope, receive, sender) | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/routing.py", line 73, in app | response = await f(request) | ^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/fastapi/routing.py", line 301, in app | raw_response = await run_endpoint_function( | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/fastapi/routing.py", line 212, in run_endpoint_function | return await dependant.call(**values) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/06.renwu/00.fix_bug/test-automation-platform-backend/src/app/api/v1/ai.py", line 67, in query_ai_analysis_data_table | ai_analysis_data = await ai.analysis_report_time(db, ai_analysis_data) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/06.renwu/00.fix_bug/test-automation-platform-backend/src/app/services/ai.py", line 362, in analysis_report_time | cursor_num = await db.execute(stmt_num) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/ext/asyncio/session.py", line 461, in execute | result = await greenlet_spawn( | ^^^^^^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 190, in greenlet_spawn | result = context.switch(*args, **kwargs) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 2362, in execute | return self._execute_internal( | ^^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 2247, in _execute_internal | result: Result[Any] = compile_state_cls.orm_execute_statement( | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/orm/context.py", line 305, in orm_execute_statement | result = conn.execute( | ^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1418, in execute | return meth( | ^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/elements.py", line 515, in _execute_on_connection | return connection._execute_clauseelement( | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1632, in _execute_clauseelement | compiled_sql, extracted_params, cache_hit = elem._compile_w_cache( | ^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/elements.py", line 703, in _compile_w_cache | compiled_sql = self._compiler( | ^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/elements.py", line 316, in _compiler | return dialect.statement_compiler(dialect, self, **kw) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/compiler.py", line 1429, in __init__ | Compiled.__init__(self, dialect, statement, **kwargs) | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/compiler.py", line 870, in __init__ | self.string = self.process(self.statement, **compile_kwargs) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/compiler.py", line 915, in process | return obj._compiler_dispatch(self, **kwargs) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/visitors.py", line 141, in _compiler_dispatch | return meth(self, **kw) # type: ignore # noqa: E501 | ^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/compiler.py", line 4824, in visit_select | text = self._compose_select_body( | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/compiler.py", line 4973, in _compose_select_body | f._compiler_dispatch( | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/visitors.py", line 141, in _compiler_dispatch | return meth(self, **kw) # type: ignore # noqa: E501 | ^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/dialects/mysql/base.py", line 1607, in visit_join | self.process( | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/compiler.py", line 915, in process | return obj._compiler_dispatch(self, **kwargs) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/visitors.py", line 141, in _compiler_dispatch | return meth(self, **kw) # type: ignore # noqa: E501 | ^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/compiler.py", line 4309, in visit_lateral | return "LATERAL %s" % self.visit_alias(lateral_, **kw) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/compiler.py", line 4262, in visit_alias | inner = alias.element._compiler_dispatch( | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/visitors.py", line 141, in _compiler_dispatch | return meth(self, **kw) # type: ignore # noqa: E501 | ^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/compiler.py", line 4305, in visit_subquery | return self.visit_alias(subquery, **kw) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/compiler.py", line 4234, in visit_alias | inner = alias.element._compiler_dispatch( | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/visitors.py", line 141, in _compiler_dispatch | return meth(self, **kw) # type: ignore # noqa: E501 | ^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/compiler.py", line 4734, in visit_select | froms = self._setup_select_stack( | ^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/compiler.py", line 4904, in _setup_select_stack | froms = compile_state._get_display_froms( | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/selectable.py", line 4793, in _get_display_froms | raise exc.InvalidRequestError( | sqlalchemy.exc.InvalidRequestError: Select statement '<sqlalchemy.sql.selectable.Select object at 0x1394546e0>' returned no FROM clauses due to auto-correlation; specify correlate(<tables>) to control correlation manually. +------------------------------------ During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/httptools_impl.py", line 409, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__ return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__ await super().__call__(scope, receive, send) File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/applications.py", line 113, in __call__ await self.middleware_stack(scope, receive, send) File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 187, in __call__ raise exc File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 165, in __call__ await self.app(scope, receive, _send) File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/middleware/cors.py", line 85, in __call__ await self.app(scope, receive, send) File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 185, in __call__ with collapse_excgroups(): ^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/contextlib.py", line 158, in __exit__ self.gen.throw(value) File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/_utils.py", line 82, in collapse_excgroups raise exc File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 187, in __call__ response = await self.dispatch_func(request, call_next) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/06.renwu/00.fix_bug/test-automation-platform-backend/src/app/middlewares/request_logger_middleware.py", line 17, in dispatch response = await call_next(request) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 163, in call_next raise app_exc File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 149, in coro await self.app(scope, receive_or_disconnect, send_no_error) File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 62, in __call__ await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app raise exc File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/routing.py", line 715, in __call__ await self.middleware_stack(scope, receive, send) File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/routing.py", line 735, in app await route.handle(scope, receive, send) File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/routing.py", line 288, in handle await self.app(scope, receive, send) File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/routing.py", line 76, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app raise exc File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/starlette/routing.py", line 73, in app response = await f(request) ^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/fastapi/routing.py", line 301, in app raw_response = await run_endpoint_function( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/fastapi/routing.py", line 212, in run_endpoint_function return await dependant.call(**values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/06.renwu/00.fix_bug/test-automation-platform-backend/src/app/api/v1/ai.py", line 67, in query_ai_analysis_data_table ai_analysis_data = await ai.analysis_report_time(db, ai_analysis_data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/06.renwu/00.fix_bug/test-automation-platform-backend/src/app/services/ai.py", line 362, in analysis_report_time cursor_num = await db.execute(stmt_num) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/ext/asyncio/session.py", line 461, in execute result = await greenlet_spawn( ^^^^^^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 190, in greenlet_spawn result = context.switch(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 2362, in execute return self._execute_internal( ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 2247, in _execute_internal result: Result[Any] = compile_state_cls.orm_execute_statement( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/orm/context.py", line 305, in orm_execute_statement result = conn.execute( ^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1418, in execute return meth( ^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/elements.py", line 515, in _execute_on_connection return connection._execute_clauseelement( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1632, in _execute_clauseelement compiled_sql, extracted_params, cache_hit = elem._compile_w_cache( ^^^^^^^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/elements.py", line 703, in _compile_w_cache compiled_sql = self._compiler( ^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/elements.py", line 316, in _compiler return dialect.statement_compiler(dialect, self, **kw) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/compiler.py", line 1429, in __init__ Compiled.__init__(self, dialect, statement, **kwargs) File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/compiler.py", line 870, in __init__ self.string = self.process(self.statement, **compile_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/compiler.py", line 915, in process return obj._compiler_dispatch(self, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/visitors.py", line 141, in _compiler_dispatch return meth(self, **kw) # type: ignore # noqa: E501 ^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/compiler.py", line 4824, in visit_select text = self._compose_select_body( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/compiler.py", line 4973, in _compose_select_body f._compiler_dispatch( File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/visitors.py", line 141, in _compiler_dispatch return meth(self, **kw) # type: ignore # noqa: E501 ^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/dialects/mysql/base.py", line 1607, in visit_join self.process( File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/compiler.py", line 915, in process return obj._compiler_dispatch(self, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/visitors.py", line 141, in _compiler_dispatch return meth(self, **kw) # type: ignore # noqa: E501 ^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/compiler.py", line 4309, in visit_lateral return "LATERAL %s" % self.visit_alias(lateral_, **kw) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/compiler.py", line 4262, in visit_alias inner = alias.element._compiler_dispatch( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/visitors.py", line 141, in _compiler_dispatch return meth(self, **kw) # type: ignore # noqa: E501 ^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/compiler.py", line 4305, in visit_subquery return self.visit_alias(subquery, **kw) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/compiler.py", line 4234, in visit_alias inner = alias.element._compiler_dispatch( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/visitors.py", line 141, in _compiler_dispatch return meth(self, **kw) # type: ignore # noqa: E501 ^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/compiler.py", line 4734, in visit_select froms = self._setup_select_stack( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/compiler.py", line 4904, in _setup_select_stack froms = compile_state._get_display_froms( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/qxz5mik/platform_work/04.code/test-automation-platform-backend/.venv/lib/python3.12/site-packages/sqlalchemy/sql/selectable.py", line 4793, in _get_display_froms raise exc.InvalidRequestError( sqlalchemy.exc.InvalidRequestError: Select statement '<sqlalchemy.sql.selectable.Select object at 0x1394546e0>' returned no FROM clauses due to auto-correlation; specify correlate(<tables>) to control correlation manually.
最新发布
08-07
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值