-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
handle exception and set dtype value to JSON, when column type JSON #5644
Conversation
@mistercrunch PTAL |
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
superset/views/core.py
Outdated
@@ -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): |
There was a problem hiding this comment.
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__
…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)
…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)
…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)
…pache#5644) * handle exception and set dtype value to JSON, when column type JSON * review comment * only when we handle exception
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'>