codemaster08240328 opened a new pull request, #20088:
URL: https://github.com/apache/superset/pull/20088

   <!---
   Please write the PR title following the conventions at 
https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   Column types not detected when creating Virtual Dataset.
   
   If we create a virtual dataset, and try to create a chart based on it, some 
column types may not be detected as it was defined in original dataset. It was 
because some columns had no any non-null values when we run the SQL to create a 
dataset. 
   The previous version was tracking column type of columns from the query 
result values, and that's why some columns had null type even though it had 
exact type in original dataset. 
   
   To fix this, we need to track the column type from original dataset, not a 
SQL query running result value.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   **BEFORE**
   
![image](https://user-images.githubusercontent.com/39701522/168673931-73577f6d-da20-4179-b797-1468d9441466.png)
   
   **AFTER**:
   ![Screen Shot 2022-05-16 at 16 01 
45](https://user-images.githubusercontent.com/39701522/168673789-edcd62f3-9fd2-4d72-a54d-789f9bdb139a.png)
   ![Screen Shot 2022-05-16 at 16 03 
10](https://user-images.githubusercontent.com/39701522/168673819-13c6ecca-6370-407a-9d81-fcb9027f7072.png)
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   1. Create a virtual dataset using this query:
   ```
   SELECT *
   FROM public."SQLLab_Test_For_VirtualDS"
   WHERE site_slug in ('connectmiles', 'rocketmiles')
   AND reward_program_slug in ('connectmiles')
   LIMIT 10
   ```
   
   2. Try to create a chart based on virtual dataset.
   3. See if all columns have exact data type, not NULL.
   
   Dataset for virtual dataset.
   
[sqllab_query_publicconnectmiles_all_reservation_stats_20220412T210849.csv](https://github.com/apache/superset/files/8703159/sqllab_query_publicconnectmiles_all_reservation_stats_20220412T210849.csv)
   
   
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] 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