bito-code-review[bot] commented on PR #44500:
URL: https://github.com/apache/superset/pull/44500#issuecomment-5760360885

   <!-- Bito Reply -->
   The flagged issue is correct. The current implementation of 
`get_timestamp_expr` in `superset/db_engine_specs/postgres.py` does not account 
for the `epoch_us` format when casting string columns to timestamps, leading to 
runtime errors when PostgreSQL attempts numeric division on text columns.
   
   To resolve this, you should update the condition in 
`superset/db_engine_specs/postgres.py` to ensure that columns configured with 
`epoch_us` are handled correctly, similar to how `epoch_s` and `epoch_ms` are 
handled. 
   
   Would you like me to fetch all other comments on this PR to validate and 
implement fixes for them as well?
   
   **superset/db_engine_specs/postgres.py**
   ```
   if time_grain and isinstance(col_type, String) and pdf not in EPOCH_FORMATS:
               expr = TimestampExpression(
                   expr.name.replace("{col}", "CAST({col} AS TIMESTAMP)"),
                   col,
               )
   ```


-- 
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