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

handle exception and set dtype value to JSON, when column type JSON #5644

Merged
merged 3 commits into from
Aug 17, 2018

Conversation

sumedhsakdeo
Copy link
Contributor

Because we pass the exception for sqlachemy.types.JSON type, in the UI when we list columns in the table we do not show the correct type.

ERROR:root:Compiler <sqlalchemy.sql.compiler.GenericTypeCompiler object at 0x7fc5aa6cad90> can't render element of type <class 'sqlalchemy.sql.sqltypes.JSON'>


@sumedhsakdeo
Copy link
Contributor Author

@mistercrunch PTAL

@codecov-io
Copy link

codecov-io commented Aug 16, 2018

Codecov Report

Merging #5644 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5644      +/-   ##
==========================================
- Coverage   63.51%   63.51%   -0.01%     
==========================================
  Files         360      360              
  Lines       22890    22891       +1     
  Branches     2549     2549              
==========================================
  Hits        14539    14539              
- Misses       8336     8337       +1     
  Partials       15       15
Impacted Files Coverage Δ
superset/views/core.py 73.93% <0%> (-0.06%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5966a67...6c2e9be. Read the comment docs.

@@ -2252,6 +2252,8 @@ def table(self, database_id, table_name, schema):
try:
dtype = '{}'.format(col['type'])
except Exception:
if isinstance(col['type'], sqla.types.JSON):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's do more generic error handling here dtype = col['type'].__class__.__name__

@mistercrunch mistercrunch merged commit cc9324a into apache:master Aug 17, 2018
@sumedhsakdeo sumedhsakdeo deleted the sumedh/column_type_json branch August 17, 2018 18:45
mistercrunch pushed a commit to lyft/incubator-superset that referenced this pull request Aug 21, 2018
…pache#5644)

* handle exception and set dtype value to JSON, when column type JSON

* review comment

* only when we handle exception

(cherry picked from commit cc9324a)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Aug 22, 2018
…pache#5644)

* handle exception and set dtype value to JSON, when column type JSON

* review comment

* only when we handle exception

(cherry picked from commit cc9324a)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Aug 22, 2018
…pache#5644)

* handle exception and set dtype value to JSON, when column type JSON

* review comment

* only when we handle exception

(cherry picked from commit cc9324a)
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
…pache#5644)

* handle exception and set dtype value to JSON, when column type JSON

* review comment

* only when we handle exception
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants