You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/04/16 00:31:44 UTC

[GitHub] [superset] czgu opened a new issue, #19737: column["is_dtttm"] is not found for Presto columns

czgu opened a new issue, #19737:
URL: https://github.com/apache/superset/issues/19737

   A clear and concise description of what the bug is.
   
   #### How to reproduce the bug
   
   1. Go to SQL Lab
   2. Run a simple query with Presto, like `select * from table limit 10`
   3. Click on EXPLORE and save to a virtual dataset
   4. See error
   
   ### Expected results
   
   The dataset should be exported
   
   ### Actual results
   
   Error is shown on frontend and server. Here is the stack trace
   ```
   Traceback (most recent call last):
     File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request
       rv = self.dispatch_request()
     File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1502, in dispatch_request
       return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
     File "/usr/local/lib/python3.8/site-packages/flask_appbuilder/security/decorators.py", line 133, in wraps
       return f(self, *args, **kwargs)
     File "/app/superset/utils/log.py", line 245, in wrapper
       value = f(*args, **kwargs)
     File "/app/superset/views/core.py", line 2129, in sqllab_viz
       db.session.commit()
     File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/scoping.py", line 163, in do
       return getattr(self.registry(), name)(*args, **kwargs)
     File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 1046, in commit
       self.transaction.commit()
     File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 504, in commit
       self._prepare_impl()
     File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 483, in _prepare_impl
       self.session.flush()
     File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 2540, in flush
       self._flush(objects)
     File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 2682, in _flush
       transaction.rollback(_capture_exception=True)
     File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
       compat.raise_(
     File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
       raise exception
     File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 2642, in _flush
       flush_context.execute()
     File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/unitofwork.py", line 422, in execute
       rec.execute(self)
     File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/unitofwork.py", line 586, in execute
       persistence.save_obj(
     File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/persistence.py", line 248, in save_obj
       _finalize_insert_update_commands(
     File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/persistence.py", line 1432, in _finalize_insert_update_commands
       mapper.dispatch.after_insert(mapper, connection, state)
     File "/usr/local/lib/python3.8/site-packages/sqlalchemy/event/attr.py", line 322, in __call__
       fn(*args, **kw)
     File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/events.py", line 731, in wrap
       fn(*arg, **kw)
     File "/app/superset/connectors/sqla/models.py", line 2021, in after_insert
       SqlaTable.write_shadow_dataset(target, database, session)
     File "/app/superset/connectors/sqla/models.py", line 2375, in write_shadow_dataset
       tables = load_or_create_tables(
     File "/app/superset/connectors/sqla/utils.py", line 217, in load_or_create_tables
       columns = [
     File "/app/superset/connectors/sqla/utils.py", line 222, in <listcomp>
       is_temporal=column["is_dttm"],
   KeyError: 'is_dttm'
   ```
   
   #### Screenshots
   
   If applicable, add screenshots to help explain your problem.
   
   ### Environment
   
   (please complete the following information):
   
   - browser type and version: Google Chrome	100.0.4896.75 
   - superset version: Latest master [ae70212]
   - python version: 3.8.12 
   - any feature flags active: {"ALERT_REPORTS": True}
   
   ### Checklist
   
   Make sure to follow these steps before submitting your issue - thank you!
   
   - [x] I have checked the superset logs for python stacktraces and included it here as text if there are any.
   - [x] I have reproduced the issue with at least the latest released version of superset.
   - [x] 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.
   
   This happened after this change https://github.com/apache/superset/pull/19714
   After some digging I think it is because in `get_physical_table_metadata`, the field `is_dttm` is only added to columns if the condition `isinstance(col["type"], TypeEngine)` is true. This is not the case for Presto as in the db engine spec it overrides `get_columns` function to return list of dictionaries 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] rusackas commented on issue #19737: column["is_dtttm"] is not found for Presto columns

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #19737:
URL: https://github.com/apache/superset/issues/19737#issuecomment-1405469055

   The "Additional context" at the bottom would be useful at the top... I was baffled until I got there. 
   
   We can ping the author of that PR and see if there's a decent resolution to this, but first off, are you still facing this issue at all in the current `master` or on 2.0.x? The issue's pretty stale, and I know a lot of people are using Presto, so I'm a little hopeful this has been resolved somewhere along the way.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] column["is_dtttm"] is not found for Presto columns [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #19737:
URL: https://github.com/apache/superset/issues/19737#issuecomment-1946858776

   Closing this as stale since it's been silent for so long, and we're trying to steer toward a more actionable Issues backlog. If people are still encountering this in current versions (currently 3.x) please re-open this issue, open a new Issue with updated context, or raise a PR to address the problem. Thanks!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] column["is_dtttm"] is not found for Presto columns [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed issue #19737: column["is_dtttm"] is not found for Presto columns
URL: https://github.com/apache/superset/issues/19737


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org