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

   Superset returns an error when I try a query with a `tstzrange` column.
   
   #### How to reproduce the bug
   
   Considering Superset have a connection to a PostgreSQL database and there is 
a table with at least one column of the type `tstzrange`, Go to "SQL Lab" -> 
"SQL Editor" and try a select query that includes the `tstzrange` column, e.g.: 
`select * from user`
   
   ### Expected results
   
   I expect to see a table with the results from the query
   
   ### Actual results
   
   An error message: 
   
   ```
   PostgreSQL Error
   
   Unserializable object [2022-05-06 21:12:02.578651+00:00, None) of type 
<class 'psycopg2._range.DateTimeTZRange'>
   
   This may be triggered by:
   Issue 1002 - The database returned an unexpected error. 
   ```
   
   Logs:
   
   ```
   
   
   
   2022-05-09 14:33:34,658:INFO:superset.sql_lab:Query 879: Executing 1 
statement(s)
   --
   Query 879: Set query to 'running'
   2022-05-09 14:33:34,658:INFO:superset.sql_lab:Query 879: Set query to 
'running'
   Query 879: Running statement 1 out of 1
   2022-05-09 14:33:35,068:INFO:superset.sql_lab:Query 879: Running statement 1 
out of 1
   [SupersetError(message="Unserializable object [2022-05-06 
21:12:02.578651+00:00, None) of type <class 
'psycopg2._range.DateTimeTZRange'>", 
error_type=<SupersetErrorType.GENERIC_DB_ENGINE_ERROR: 
'GENERIC_DB_ENGINE_ERROR'>, level=<ErrorLevel.ERROR: 'error'>, 
extra={'engine_name': 'PostgreSQL', 'issue_codes': [{'code': 1002, 'message': 
'Issue 1002 - The database returned an unexpected error.'}]})]
   Traceback (most recent call last):
   File "/app/superset/views/base.py", line 211, 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 2574, in sql_json
   command_result: CommandResult = command.run()
   File "/app/superset/sqllab/command.py", line 104, in run
   raise ex
   File "/app/superset/sqllab/command.py", line 96, in run
   status = self._run_sql_json_exec_from_scratch()
   File "/app/superset/sqllab/command.py", line 138, in 
_run_sql_json_exec_from_scratch
   raise ex
   File "/app/superset/sqllab/command.py", line 133, in 
_run_sql_json_exec_from_scratch
   return self._sql_json_executor.execute(
   File "/app/superset/sqllab/sql_json_executer.py", line 111, in execute
   raise SupersetErrorsException(
   superset.exceptions.SupersetErrorsException: 
[SupersetError(message="Unserializable object [2022-05-06 
21:12:02.578651+00:00, None) of type <class 
'psycopg2._range.DateTimeTZRange'>", 
error_type=<SupersetErrorType.GENERIC_DB_ENGINE_ERROR: 
'GENERIC_DB_ENGINE_ERROR'>, level=<ErrorLevel.ERROR: 'error'>, 
extra={'engine_name': 'PostgreSQL', 'issue_codes': [{'code': 1002, 'message': 
'Issue 1002 - The database returned an unexpected error.'}]})]
   2022-05-09 
14:33:35,871:WARNING:superset.views.base:[SupersetError(message="Unserializable 
object [2022-05-06 21:12:02.578651+00:00, None) of type <class 
'psycopg2._range.DateTimeTZRange'>", 
error_type=<SupersetErrorType.GENERIC_DB_ENGINE_ERROR: 
'GENERIC_DB_ENGINE_ERROR'>, level=<ErrorLevel.ERROR: 'error'>, 
extra={'engine_name': 'PostgreSQL', 'issue_codes': [{'code': 1002, 'message': 
'Issue 1002 - The database returned an unexpected error.'}]})]
   Traceback (most recent call last):
   File "/app/superset/views/base.py", line 211, 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 2574, in sql_json
   command_result: CommandResult = command.run()
   File "/app/superset/sqllab/command.py", line 104, in run
   raise ex
   File "/app/superset/sqllab/command.py", line 96, in run
   status = self._run_sql_json_exec_from_scratch()
   File "/app/superset/sqllab/command.py", line 138, in 
_run_sql_json_exec_from_scratch
   raise ex
   File "/app/superset/sqllab/command.py", line 133, in 
_run_sql_json_exec_from_scratch
   return self._sql_json_executor.execute(
   File "/app/superset/sqllab/sql_json_executer.py", line 111, in execute
   raise SupersetErrorsException(
   superset.exceptions.SupersetErrorsException: 
[SupersetError(message="Unserializable object [2022-05-06 
21:12:02.578651+00:00, None) of type <class 
'psycopg2._range.DateTimeTZRange'>", 
error_type=<SupersetErrorType.GENERIC_DB_ENGINE_ERROR: 
'GENERIC_DB_ENGINE_ERROR'>, level=<ErrorLevel.ERROR: 'error'>, 
extra={'engine_name': 'PostgreSQL', 'issue_codes': [{'code': 1002, 'message': 
'Issue 1002 - The database returned an unexpected error.'}]})]
   ```
   
   
   
   ### Environment
   
   (please complete the following information):
   
   - browser type and version: Firefox 100
   
   Using 
[apache/superset:1.5.0](https://hub.docker.com/layers/superset/apache/superset/1.5.0/images/sha256-8f1865a6ff43b1471d271901fc9d5feac84b8cbfdeb3b35d35cbbdcde3b751b3?context=explore)
   
   
   ### 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.
   
   
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to