javidov opened a new issue #11767:
URL: https://github.com/apache/incubator-superset/issues/11767


   After creating a **table visualization** in "Explore view", I can change the 
"**time grain**" after checking **"Include Time"** and see the displayed 
results with correct **Datetime** formats (**"Table Timestamp Format"** is set 
to **"Adaptative formating"**). Next I added the **saved table chart** to a 
**"dashboard"** along with a **"filter_box"** created to provide the ability to 
change the **"time grain"** of **Datetime** (noted as **Time**) column of the 
table viz. However when I choose a **"time grain" from the "filter"box"**, the 
new **Datetime format of Time column** corresponding to **new** "time grain" is 
**incorrectly displayed**. 
    New fetched records are displayed with **"Time" column format** 
corresponding to the initial **"time_grain_sqla"** format saved in **chart 
metadata** after saving the chart from the **"Explore view"**. 
   
   ### Expected results
   
   **"Time" column format** change in dashboard after changing **"time grain"** 
value from **filter_box.**
   
   ### Actual results
   
   Records are correctly fetched from database (**clickhouse**), but the 
displayed **Datetime format** in **"Time" column** are based on **"time grain" 
set after creating and saving table viz from "Explore view".**
   
   #### Screenshots
   This is when I set "time grain" to **year** in Explore view, results are 
correct
   
![year](https://user-images.githubusercontent.com/74787835/99833639-02004800-2b6b-11eb-8c42-2039f1d8b1fc.PNG)
   
   This is when I set "time grain" to **month** in Explore view, results are 
correct. **The chart is **SAVED** with month as time grain.**
   
![month](https://user-images.githubusercontent.com/74787835/99833805-42f85c80-2b6b-11eb-922e-d1b7620ab205.PNG)
   
   This is the **initial view from the dashboard**. The table is displayed with 
**"time grain" equal to month** (table viz is saved with month time grain in 
explore view).
   
![initial](https://user-images.githubusercontent.com/74787835/99833852-57d4f000-2b6b-11eb-870a-29c73603ef42.PNG)
   
   When new **"Time grain" is selected** from "Time grain" **dropdown of 
filter_box,** records are fetched successfully, but **Datetime format for 
"Time" column is incorrect**.
   
![thebug](https://user-images.githubusercontent.com/74787835/99834087-b13d1f00-2b6b-11eb-9b95-34f9e01593aa.PNG)
   
   This is the expected results in **Dashboard** (as seen in explore view).
   
![expected](https://user-images.githubusercontent.com/74787835/99834325-07aa5d80-2b6c-11eb-8e78-4d1802bfb405.PNG)
   
   
   
   
   
   #### How to reproduce the bug
   
   1. **Create** table visualization.
   2. Choose **"Include time"**.
   3. Select metrics to display.
   4. Select a **"Time grain"** from **"Time related form attributes"**
   5. **Save** the chart.
   6. Create **Filter_box** viz,  check **"the Show SQL Granularity Dropdown"**
   7. Add table and filter_box viz to a dashboard and select a "Time grain" 
value from filter_box dropdown 
   ### Environment
   
   (please complete the following information):
   
   - superset version: `0.37.2`
   - python version: `2.7.17`
   - Clickhouse version : `19.17.6.36`
   - Ubuntu version : `Ubuntu 18.04.5`
   
   ### Checklist
   
   Make sure to follow these steps before submitting your issue - thank you!
   
   - [ ] I have checked the superset logs for python stacktraces and included 
it here as text if there are any.
   - [ ] I have reproduced the issue with at least the latest released version 
of superset.
   - [ ] I have checked the issue tracker for the same issue and I haven't 
found one similar.
   
   ### Additional context
   
   Add any other context about the problem here.
   


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