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

[Chart] Can't use custom SQL in chart since 2.0.0 upgrade #21689

Closed
3 tasks done
zhaorui2022 opened this issue Oct 3, 2022 · 3 comments · Fixed by #21729
Closed
3 tasks done

[Chart] Can't use custom SQL in chart since 2.0.0 upgrade #21689

zhaorui2022 opened this issue Oct 3, 2022 · 3 comments · Fixed by #21729
Assignees
Labels
#bug:regression Bugs that are identified as regessions #bug Bug report v1.5 v2.0

Comments

@zhaorui2022
Copy link
Contributor

zhaorui2022 commented Oct 3, 2022

We have an issue reported from our user where chart fails when adding a column using custom SQL. The case we have seen is a column with type BIGINT. The user was trying to do some simple calculation like column_name/6000, however, it throws an error both on the UI and in the backend server where it says Expected text or file-like object, got <class 'dict'>. This should not be chart type specific and we have reproduced this error with both histogram and data table.

This functionality was working as expected before upgrading to 2.0.0, so it is likely to be a regression. And I can reproduce this error in the latest master branch as of 10/03/2022 3:30PM.

How to reproduce the bug

  1. Go to chart, create a new chart
  2. When adding a new column, select custom SQL, and put any valid SQL statement
  3. Click on save, and update chart
  4. See error

Expected results

Chart updated with custom SQL.

Actual results

Fails due to Expected text or file-like object, got <class 'dict'>

Screenshots

Google Chrome - Superset - 2022-10-03 at 3 48 29 PM

Environment

(please complete the following information):

  • browser type and version: not browser specific
  • superset version: 2.0.0, can be reproduced with latest commit on master branch as of 10/03/2022 3:30PM PST
  • python version: 3.8
  • node.js version: N/A
  • any feature flags active:

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

Add any other context about the problem here.

@zhaorui2022 zhaorui2022 added the #bug Bug report label Oct 3, 2022
@zhaorui2022
Copy link
Contributor Author

I was also able to reproduce this error in the latest master branch with docker-compose up

@zhaorui2022 zhaorui2022 changed the title [Chart] Can't use custom SQL in chart [Chart] Can't use custom SQL in chart since 2.0.0 upgrade Oct 3, 2022
@mayurnewase
Copy link
Contributor

mayurnewase commented Oct 4, 2022

regression from : #19454
also exists in 1.5
looks critical.

@mayurnewase
Copy link
Contributor

mayurnewase commented Oct 4, 2022

I did little digging, and looks like there is issue in sqla/models.py/SqlaTable/get_sqla_query function.
and attached patch would be helpful to fix it, if no one takes this on I will take it later when I get some time.

21689_diff.txt

@villebro villebro added #bug:regression Bugs that are identified as regessions v2.0 v1.5 labels Oct 4, 2022
@mayurnewase mayurnewase self-assigned this Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#bug:regression Bugs that are identified as regessions #bug Bug report v1.5 v2.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants