Bug description

  1. when i query the connected odps database, the error is as follows Apache Superset  When I use superset to query the connected odps database, the error ODPSEngineSpec.execute() takes 3 positional arguments but 4 were given

  2. The detailed error log is as follows

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/usr/local/lib/python3.10/site-packages/flask_appbuilder/security/decorators.py", line 95, in wraps
    return f(self, *args, **kwargs)
  File "/app/superset/views/base_api.py", line 119, in wraps
    duration, response = time_function(f, self, *args, **kwargs)
  File "/app/superset/utils/core.py", line 1364, in time_function
    response = func(*args, **kwargs)
  File "/app/superset/views/base_api.py", line 91, in wraps
    return f(self, *args, **kwargs)
  File "/app/superset/utils/log.py", line 303, in wrapper
    value = f(*args, **kwargs)
  File "/app/superset/sqllab/api.py", line 409, in execute_sql_query
    command_result: CommandResult = command.run()
  File "/app/superset/utils/decorators.py", line 266, in wrapped
    return on_error(ex)
  File "/app/superset/utils/decorators.py", line 236, in on_error
    raise ex
  File "/app/superset/utils/decorators.py", line 259, in wrapped
    result = func(*args, **kwargs)
  File "/app/superset/commands/sql_lab/execute.py", line 105, in run
    status = self._run_sql_json_exec_from_scratch()
  File "/app/superset/commands/sql_lab/execute.py", line 158, in _run_sql_json_exec_from_scratch
    return self._sql_json_executor.execute(
  File "/app/superset/sqllab/sql_json_executer.py", line 111, in execute
    raise SupersetErrorsException(
superset.exceptions.SupersetErrorsException: [SupersetError(message='odps error: ODPSEngineSpec.execute() takes 3 positional arguments but 4 were given', error_type=, level=, extra={'engine_name': 'ODPS', 'issue_codes': [{'code': 1002, 'message': 'Issue 1002 - The database returned an unexpected error.'}]})]
  1. The relevant database and driver versions are as follows: Apache Superset  When I use superset to query the connected odps database, the error ODPSEngineSpec.execute() takes 3 positional arguments but 4 were given

Screenshots/recordings

No response

Superset version

4.1.1

Python version

3.10

Node version

I don't know

Browser

Chrome

Additional context

No response

Checklist

  • [X] I have searched Superset docs and Slack and didn't find a solution to my problem.
  • [X] I have searched the GitHub issue tracker and didn't find a similar bug report.
  • [X] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Comment From: dosubot[bot]

@yujun2021 Hello there! I'm Dosu, a bot here to help you with bug fixes, questions, and becoming a contributor. Let's tackle this issue together while we wait for a human maintainer.

The error you're encountering indicates that the ODPSEngineSpec.execute() method is being called with more arguments than it expects. This typically suggests a mismatch between the method's implementation and how it's being invoked.

To resolve this issue, you can try the following steps:

  1. Check the Method Signature: Verify the current implementation of the ODPSEngineSpec.execute() method in your Superset codebase. Ensure that the number of arguments being passed matches the method's signature.

  2. Review Recent Changes: If there have been recent updates to the Superset codebase or the ODPS-related packages (odps or pyodps), check if any changes might have affected the method signature or its usage.

  3. Compatibility: Ensure that the versions of Superset, odps, and pyodps you are using are compatible. Sometimes, version mismatches can lead to such issues.

  4. Custom Modifications: If there are any custom modifications or extensions in your Superset setup, review them to ensure they align with the expected method signatures.

If these steps do not resolve the issue, you may need to look into the specific implementation details of the ODPSEngineSpec class and how it interacts with the rest of the Superset codebase.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

Comment From: AasmitPadea

@dosu please assign this issue to me

Comment From: yujun2021

@dosu please assign this issue to me

Is there any solution?

Comment From: dosubot[bot]

Could you provide more details about any recent changes or updates made to your Superset setup or the ODPS-related packages? Additionally, are there any custom modifications in your Superset environment that might affect the ODPSEngineSpec.execute() method? This information could help in identifying the root cause of the issue.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

Comment From: wjsi

Should be resolved with PyODPS 0.12.2 release. See https://github.com/aliyun/aliyun-odps-python-sdk/releases/tag/v0.12.2 for details.

Comment From: yujun2021

Should be resolved with PyODPS 0.12.2 release. See https://github.com/aliyun/aliyun-odps-python-sdk/releases/tag/v0.12.2 for details.

1) When I uninstalled the old version 0.12.1.1 of pyodps and installed the new version 0.12.2, the same error was reported. The details are as follows Apache Superset  When I use superset to query the connected odps database, the error ODPSEngineSpec.execute() takes 3 positional arguments but 4 were given

2) I suspect there is something wrong with the way the connection is made, or pyodps doesn't really fix the error. Apache Superset  When I use superset to query the connected odps database, the error ODPSEngineSpec.execute() takes 3 positional arguments but 4 were given

Comment From: yujun2021

Anyone can help on this issue?

Comment From: wjsi

Should be resolved with PyODPS 0.12.2 release. See https://github.com/aliyun/aliyun-odps-python-sdk/releases/tag/v0.12.2 for details.

  1. When I uninstalled the old version 0.12.1.1 of pyodps and installed the new version 0.12.2, the same error was reported. The details are as follows
  2. I suspect there is something wrong with the way the connection is made, or pyodps doesn't really fix the error.

Apache Superset  When I use superset to query the connected odps database, the error ODPSEngineSpec.execute() takes 3 positional arguments but 4 were given Works for me. Given the error message it is quite possible that the correct version is not properly installed for superset as the function signature is already correct for the latest version of superset.

Comment From: yujun2021

Should be resolved with PyODPS 0.12.2 release. See https://github.com/aliyun/aliyun-odps-python-sdk/releases/tag/v0.12.2 for details.

  1. When I uninstalled the old version 0.12.1.1 of pyodps and installed the new version 0.12.2, the same error was reported. The details are as follows
  2. I suspect there is something wrong with the way the connection is made, or pyodps doesn't really fix the error.

Works for me. Given the error message it is quite possible that the correct version is not properly installed for superset as the function signature is already correct for the latest version of superset.

I'm curious how you deployed the superset service. I installed it through k8s helm chart, and then pip install pyodps==0.12.2; my superset version is 4.1.1

Comment From: wjsi

Should be resolved with PyODPS 0.12.2 release. See https://github.com/aliyun/aliyun-odps-python-sdk/releases/tag/v0.12.2 for details.

  1. When I uninstalled the old version 0.12.1.1 of pyodps and installed the new version 0.12.2, the same error was reported. The details are as follows
  2. I suspect there is something wrong with the way the connection is made, or pyodps doesn't really fix the error.

Works for me. Given the error message it is quite possible that the correct version is not properly installed for superset as the function signature is already correct for the latest version of superset.

I'm curious how you deployed the superset service. I installed it through k8s helm chart, and then pip install pyodps==0.12.2; my superset version is 4.1.1

Installed with pip inside a virtualenv on host without any containers.

Comment From: yujun2021

Should be resolved with PyODPS 0.12.2 release. See https://github.com/aliyun/aliyun-odps-python-sdk/releases/tag/v0.12.2 for details.

  1. When I uninstalled the old version 0.12.1.1 of pyodps and installed the new version 0.12.2, the same error was reported. The details are as follows
  2. I suspect there is something wrong with the way the connection is made, or pyodps doesn't really fix the error.

Works for me. Given the error message it is quite possible that the correct version is not properly installed for superset as the function signature is already correct for the latest version of superset.

I'm curious how you deployed the superset service. I installed it through k8s helm chart, and then pip install pyodps==0.12.2; my superset version is 4.1.1

Installed with pip inside a virtualenv on host without any containers.

1)The above problem has been solved!thank you very much! 2)A new problem has arisen. Although I can query the data of the odps database, I cannot obtain the metadata of the database table, such as column and field information. the following situation Apache Superset  When I use superset to query the connected odps database, the error ODPSEngineSpec.execute() takes 3 positional arguments but 4 were given

Apache Superset  When I use superset to query the connected odps database, the error ODPSEngineSpec.execute() takes 3 positional arguments but 4 were given

Comment From: wjsi

... conversation omitted ...

1)The above problem has been solved!thank you very much! 2)A new problem has arisen. Although I can query the data of the odps database, I cannot obtain the metadata of the database table, such as column and field information. the following situation

It cannot be resolved currently as Superset points to the base db engine spec instead of the customized one when running SQL statements to obtain database meta. It might be resolved when MaxCompute is added to dialects of sqlglot but this absolutely takes time.

Comment From: yujun2021

... conversation omitted ...

1)The above problem has been solved!thank you very much! 2)A new problem has arisen. Although I can query the data of the odps database, I cannot obtain the metadata of the database table, such as column and field information. the following situation

It cannot be resolved currently as Superset points to the base db engine spec instead of the customized one when running SQL statements to obtain database meta. It might be resolved when MaxCompute is added to dialects of sqlglot but this absolutely takes time.

It would be great if these problems could be solved, do we have any plans to solve these problems?

Comment From: wjsi

... conversation omitted ...

1)The above problem has been solved!thank you very much! 2)A new problem has arisen. Although I can query the data of the odps database, I cannot obtain the metadata of the database table, such as column and field information. the following situation

It cannot be resolved currently as Superset points to the base db engine spec instead of the customized one when running SQL statements to obtain database meta. It might be resolved when MaxCompute is added to dialects of sqlglot but this absolutely takes time.

It would be great if these problems could be solved, do we have any plans to solve these problems?

It takes time and will not be resolved right now.

Comment From: yujun2021

... conversation omitted ...

1)The above problem has been solved!thank you very much! 2)A new problem has arisen. Although I can query the data of the odps database, I cannot obtain the metadata of the database table, such as column and field information. the following situation

It cannot be resolved currently as Superset points to the base db engine spec instead of the customized one when running SQL statements to obtain database meta. It might be resolved when MaxCompute is added to dialects of sqlglot but this absolutely takes time.

It would be great if these problems could be solved, do we have any plans to solve these problems?

It takes time and will not be resolved right now.

1) When I was about to save the data set, I found that I couldn't get an error. Image

2)Loading the data set will also report an error Image

Comment From: yujun2021

... conversation omitted ...

1)The above problem has been solved!thank you very much! 2)A new problem has arisen. Although I can query the data of the odps database, I cannot obtain the metadata of the database table, such as column and field information. the following situation

It cannot be resolved currently as Superset points to the base db engine spec instead of the customized one when running SQL statements to obtain database meta. It might be resolved when MaxCompute is added to dialects of sqlglot but this absolutely takes time.

It would be great if these problems could be solved, do we have any plans to solve these problems?

It takes time and will not be resolved right now.

I encountered two problems when using superset to connect to the odps database 1) The odps data set cannot be created successfully.

Image

2) odps metadata information and column names cannot be displayed Image I hope as follows Image

3)My odps version is v0.12.2, superset version 4.1.1. I would be very grateful if there is a plan to correct these problems recently.

Comment From: yujun2021

2025-01-18 13:51:14,169:ERROR:flask_appbuilder.api:Error parsing near '' at line 2:14 Traceback (most recent call last): File "/app/superset/sql/parse.py", line 256, in _parse return sqlglot.parse(script, dialect=dialect) File "/usr/local/lib/python3.10/site-packages/sqlglot/__init__.py", line 102, in parse return Dialect.get_or_raise(read or dialect).parse(sql, **opts) File "/usr/local/lib/python3.10/site-packages/sqlglot/dialects/dialect.py", line 919, in parse return self.parser(**opts).parse(self.tokenize(sql), sql) File "/usr/local/lib/python3.10/site-packages/sqlglot/parser.py", line 1395, in parse return self._parse( File "/usr/local/lib/python3.10/site-packages/sqlglot/parser.py", line 1467, in _parse self.raise_error("Invalid expression / Unexpected token") File "/usr/local/lib/python3.10/site-packages/sqlglot/parser.py", line 1508, in raise_error raise error sqlglot.errors.ParseError: Invalid expression / Unexpected token. Line 2, Col: 14. SELECT * FROMdefault.播放action` LIMIT 100

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/flask_appbuilder/api/init.py", line 111, in wraps return f(self, args, kwargs) File "/app/superset/views/base_api.py", line 119, in wraps duration, response = time_function(f, self, args, kwargs) File "/app/superset/utils/core.py", line 1364, in time_function response = func(*args, kwargs) File "/app/superset/utils/log.py", line 303, in wrapper value = f(args, kwargs) File "/app/superset/views/base_api.py", line 91, in wraps return f(self, args, **kwargs) File "/app/superset/datasets/api.py", line 338, in post return self.response(201, id=new_model.id, result=item, data=new_model.data) File "/app/superset/connectors/sqla/models.py", line 1416, in data data_ = super().data File "/app/superset/connectors/sqla/models.py", line 404, in data "select_star": self.select_star, File "/app/superset/connectors/sqla/models.py", line 1395, in select_star return self.database.select_star( File "/app/superset/models/core.py", line 719, in select_star return self.db_engine_spec.select_star( File "/app/superset/db_engine_specs/base.py", line 1689, in select_star sql = SQLScript(sql, engine=cls.engine).format() File "/app/superset/sql/parse.py", line 611, in init self.statements = statement_class.split_script(script, engine) File "/app/superset/sql/parse.py", line 316, in split_script ast = cls._parse(remainder, engine)[0] File "/app/superset/sql/parse.py", line 259, in _parse raise SupersetParseError( superset.exceptions.SupersetParseError: Error parsing near '`' at line 2:14

Comment From: zhongsheng-chen

Hi, I suffer the same issue, Anyone can help me out, I will appreciated. Here are versions of some packages installed, pyodps=0.12.2(the latest version) and apache-superset=4.1.1. ODPS is deployed inner my company. The version of ODPS did not support schema, but superset UI set schema for ODPS to 'Default'. I can not choose schema for another.

Comment From: yujun2021

Hi, I suffer the same issue, Anyone can help me out, I will appreciated. Here are versions of some packages installed, pyodps=0.12.2(the latest version) and apache-superset=4.1.1. ODPS is deployed inner my company. The version of ODPS did not support schema, but superset UI set schema for ODPS to 'Default'. I can not choose schema for another.

You should add the following setting to the connection url &project_as_schema=true

Comment From: rusackas

This has been silent for quite a while, and I'm not quite sure why it was reopened. Can anyone recap the bug to fix?