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

Error loading charts for presto table with null column types #10743

Closed
3 tasks done
michellethomas opened this issue Aug 31, 2020 · 5 comments · Fixed by #10753
Closed
3 tasks done

Error loading charts for presto table with null column types #10743

michellethomas opened this issue Aug 31, 2020 · 5 comments · Fixed by #10753
Assignees
Labels
!deprecated-label:bug Deprecated label - Use #bug instead v0.38

Comments

@michellethomas
Copy link
Contributor

michellethomas commented Aug 31, 2020

When loading chart based on a presto table that has null column type get an error on this line because type_ is None. @villebro looks like this was added here

Expected results

Chart should load

Actual results

Error on chart

  File "/srv/superset-internal/incubator-superset/superset/db_engine_specs/base.py", line 901, in get_sqla_column_type
    match = regex.match(type_)
TypeError: expected string or bytes-like object

How to reproduce the bug

  1. Create a datasource with columns that have null types
  2. Try to create a chart with the datasource

Environment

(please complete the following information):

  • superset version: master
  • python version: 3.7

Checklist

Make sure these boxes are checked 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.
@michellethomas michellethomas added the !deprecated-label:bug Deprecated label - Use #bug instead label Aug 31, 2020
@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.91. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@villebro
Copy link
Member

villebro commented Sep 1, 2020

Thanks @michellethomas and sorry for the regression; I'll make a fix in a second 👍

@villebro
Copy link
Member

villebro commented Sep 1, 2020

@michellethomas I'd like to add some unit tests to minimize risk of future breakage, as currently the methods are quite light on unit tests and are fairly complex. Would you be able to provide me with a few complex nested data types that you've encountered in your env that I could use as a template for a few unit tests? Ping @john-bodley

@bkyryliuk
Copy link
Member

Json type example:

SELECT CAST(CAST(ROW(123, 'abc', true) AS ROW(v1 BIGINT, v2 VARCHAR, v3 BOOLEAN)) AS JSON) -- JSON '[123,"abc",true]'

row type example:

SELECT
    CAST(ROW(1, 2.0) AS ROW(x BIGINT, y DOUBLE)) as simple_row

map type example:

select MAP(ARRAY['foo', 'bar'], ARRAY[1, 2]) as column

@villebro
Copy link
Member

Thanks @bkyryliuk !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
!deprecated-label:bug Deprecated label - Use #bug instead v0.38
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants