villebro opened a new pull request #12933:
URL: https://github.com/apache/superset/pull/12933


   ### SUMMARY
   Currently query result formats are checked based on the `dtype` property of 
the `DataFrame` coming back from the database. This works for some types, but 
not
   - columns that contain nulls (a known limitation in Pandas which causes an 
otherwise regular `int` column to become  `object`)
   - date (=always `object`)
   - UTC based timestamps (all timestamps were `datetime64[ns, UTC]` on e.g. 
BigQuery when the `dtype` was cast to string, causing it to be returned as a 
non-temporal type)
   
   This is really just a quick fix to make table chart column types work 
properly, as we're currently inferring column datatypes in three (!) different 
places in the codebase. I bigger refactor uniting these into one place needs to 
be done ASAP, but is left to a later PR.
   
   ### AFTER
   This screenshot shows `TIMESTAMP`, `DATETIME` and `DATE` columns on a 
BigQuery dataset on table chart with this fix
   
![image](https://user-images.githubusercontent.com/33317356/106820681-75065e80-6684-11eb-960a-5d7d47c1ffa1.png)
   
   ### BEFORE
   The same chart prior to the PR
   
![image](https://user-images.githubusercontent.com/33317356/106820790-a54dfd00-6684-11eb-8ccc-dcf28deefc9f.png)
   
   ### TEST PLAN
   Local testing on various databases + new tests
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Changes UI
   - [ ] Requires DB Migration.
   - [ ] Confirm DB Migration upgrade and downgrade tested.
   - [ ] 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.

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