<p dir="auto">Hi guys,</p>
<p dir="auto">I met an issue, I want to use Table View to show the table column, I succeed to create slice like this:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/8220811/17132618/1d7d8d6a-5355-11e6-8fc4-3f47fc98d675.png"><img src="https://cloud.githubusercontent.com/assets/8220811/17132618/1d7d8d6a-5355-11e6-8fc4-3f47fc98d675.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">But when I use it into the dashboard, I get this error:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/8220811/17132573/f318af00-5354-11e6-8605-6b744c63b33a.png"><img src="https://cloud.githubusercontent.com/assets/8220811/17132573/f318af00-5354-11e6-8605-6b744c63b33a.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">I found this error will happened no matter what table I use. Is it a bug?</p>
<p dir="auto">PS: I just followed the doc to install the caravel : <a href="http://airbnb.io/caravel/installation.html#caravel-installation-and-initialization" rel="nofollow">http://airbnb.io/caravel/installation.html#caravel-installation-and-initialization</a></p>
<p dir="auto">Within the SQL Editor section of SQL Lab, when you select the “+” icon beside the current tab to create a new query, the name of the query gets increased incrementally (see the image below) [except there is consistently a duplicate name for the first two].</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/96579982/155739797-11b0e6cf-fd9f-4b31-ba1f-2b77c87002f9.PNG"><img src="https://user-images.githubusercontent.com/96579982/155739797-11b0e6cf-fd9f-4b31-ba1f-2b77c87002f9.PNG" alt="plus button" style="max-width: 100%;"></a></p>
<p dir="auto">However, if you select the “+“ icon on the top right of the web page beside the settings drop down and select “SQL query“, the names of the new queries do not increase incrementally. They are all just named "Untitled Query 2" (see the images below).</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/96579982/155739987-1d8b472d-118f-4d1e-8717-8bfe937cc9d9.PNG"><img src="https://user-images.githubusercontent.com/96579982/155739987-1d8b472d-118f-4d1e-8717-8bfe937cc9d9.PNG" alt="SQL query button" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/96579982/155739999-297b9ccd-3ed4-4842-8fd2-a0ba6a24e825.PNG"><img src="https://user-images.githubusercontent.com/96579982/155739999-297b9ccd-3ed4-4842-8fd2-a0ba6a24e825.PNG" alt="After SQL query button" style="max-width: 100%;"></a></p>
<p dir="auto">In the image above, the query tab in the far right was created using the "SQL query" button under the “+“ icon drop down on the top right of the page. As you can see, the query name was not increased incrementally.</p>
<h4 dir="auto">How to reproduce the bug</h4>
<ol dir="auto">
<li>Go to the SQL Editor page by selecting it from the main menu under the "SQL Lab" drop down.</li>
<li>You can immediately notice one of the bugs that occurs, the first untitled query will always be called "Untitled Query 2", never "Untitled Query 1".</li>
<li>Click on the "+" button next to the list of query tabs, it should properly increment the query tab names.</li>
<li>Select the “+“ icon on the top right of the web page beside the settings drop down, and then click "SQL query"</li>
<li>You will notice that the name of the newly created query is "Untitled Query 2". No matter how many times you complete step 4, it will never increment the new query tab names.</li>
</ol>
<h3 dir="auto">Expected results</h3>
<p dir="auto">When either the "+" button next to the query tabs or the "SQL query" button from the drop down is selected, they should both increment the name of the untitled query properly.</p>
<h3 dir="auto">Actual results</h3>
<p dir="auto">When the "SQL query" button from the drop down is selected, the newly created query tabs are always named "Untitled Query 2". Also, the way the code is currently implemented, there will never be an "Untitled Query 1".</p>
<h4 dir="auto">Screenshots</h4>
<p dir="auto">Please see the main summary for screenshots</p>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>operating system name and version: Ubuntu 20.04</li>
<li>browser type and version: Google Chrome (Version 97.0.4692.71)</li>
<li>superset version: Superset 1.4</li>
<li>python version: Python 3.8.12</li>
<li>node.js version: Node v14.16.1</li>
<li>any feature flags active: N/A</li>
</ul>
<h3 dir="auto">Checklist</h3>
<p dir="auto">Make sure to follow these steps before submitting your issue - thank you!</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the superset logs for python stacktraces and included it here as text if there are any.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have reproduced the issue with at least the latest released version of superset.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the issue tracker for the same issue and I haven't found one similar.</li>
</ul>
<h3 dir="auto">Additional context</h3>
<p dir="auto">Also, since discovering this bug, I have created a fix for it on my local fork. I will create a corresponding PR that fixes this bug (and link it to this issue).</p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1150739428" data-permission-text="Title is private" data-url="https://github.com/apache/superset/issues/18951" data-hovercard-type="pull_request" data-hovercard-url="/apache/superset/pull/18951/hovercard" href="https://github.com/apache/superset/pull/18951">#18951</a></li>
</ul>