michael-s-molina opened a new pull request, #30389:
URL: https://github.com/apache/superset/pull/30389

   ### SUMMARY
   This PR fixes an issue with pre-query normalization when dealing with custom 
SQL. Previously, a custom SQL that had a label that does not match any column 
name would throw the following error:
   
   ```
   superset/superset/connectors/sqla/models.py", line 1691, in 
_normalize_prequery_result_type
       column_ = columns_by_name[dimension]
   KeyError: 'custom_sql'
   ```
   
   Given function docs:
   
   ```
   Convert a prequery result type to its equivalent Python type.
   
   Some databases like Druid will return timestamps as strings, but do not 
perform
   automatic casting when comparing these strings to a timestamp. For cases like
   this we convert the value via the appropriate SQL transform.
   ```
   
   We simply skip the conversion of custom SQL types as we cannot determine if 
they are temporal or not currently.
   
   ### TESTING INSTRUCTIONS
   I added a test case that should be sufficient.
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


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