<p dir="auto">Currently when user edits datasource name of the <strong>Edit Dataset</strong> modal on Chart Explore, it looks like this change is saved globally for all charts / the original datasource gets renamed.</p>
<p dir="auto">When user edits chart using Change Dataset option on Chart Explore, it only changes dataset locally for the chart.</p>
<h3 dir="auto">Expected results</h3>
<p dir="auto">Is this behavior expected? Changing the dataset globally for all charts / actually renaming a dataset (which impacts all charts using this dataset) seems problematic to do on chart explore, when a user who doesn't own the other charts can do this. It is really not clear to the user that it will change for all charts - especially because in the past, this only changed locally for the chart.</p>
<h3 dir="auto">Actual results</h3>
<p dir="auto">Renames dataset, so it's easy to break all charts!</p>
<h4 dir="auto">Screenshots</h4>
<p dir="auto">I had two different chars using same dataset (broken). Wanted to change this for one of the charts. It got changed for both charts. (In this case it sounds great, but in most cases, it will unexpectedly break charts of other people).</p>
<p dir="auto">Two different charts:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/61221714/97522664-87724d00-195d-11eb-8f23-201d46802061.png"><img width="602" alt="Screen Shot 2020-10-28 at 8 27 13 PM" src="https://user-images.githubusercontent.com/61221714/97522664-87724d00-195d-11eb-8f23-201d46802061.png" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/61221714/97522668-88a37a00-195d-11eb-8720-2f7b9a275da4.png"><img width="600" alt="Screen Shot 2020-10-28 at 8 27 07 PM" src="https://user-images.githubusercontent.com/61221714/97522668-88a37a00-195d-11eb-8720-2f7b9a275da4.png" style="max-width: 100%;"></a></p>
<p dir="auto">This modal changes dataset for both:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/61221714/97522815-e0da7c00-195d-11eb-85f2-82c45d746ace.png"><img width="965" alt="Screen Shot 2020-10-28 at 8 40 40 PM" src="https://user-images.githubusercontent.com/61221714/97522815-e0da7c00-195d-11eb-85f2-82c45d746ace.png" style="max-width: 100%;"></a></p>
<h4 dir="auto">How to reproduce the bug</h4>
<ol dir="auto">
<li>Go to Chart Explore</li>
<li>Click on Edit dataset and change dataset</li>
<li>See that all charts using the old dataset changed to new dataset</li>
</ol>
<h3 dir="auto">Environment</h3>
<p dir="auto">(please complete the following information):</p>
<ul dir="auto">
<li>superset version: <code class="notranslate">master</code></li>
</ul>
<h3 dir="auto">Checklist</h3>
<p dir="auto">Make sure these boxes are checked 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"> 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">Recent discussion: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="716721485" data-permission-text="Title is private" data-url="https://github.com/apache/superset/issues/11190" data-hovercard-type="issue" data-hovercard-url="/apache/superset/issues/11190/hovercard" href="https://github.com/apache/superset/issues/11190">#11190</a><br>
Recently closed bug: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="726975761" data-permission-text="Title is private" data-url="https://github.com/apache/superset/issues/11380" data-hovercard-type="issue" data-hovercard-url="/apache/superset/issues/11380/hovercard" href="https://github.com/apache/superset/issues/11380">#11380</a></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 issue tracker for the same issue and I haven't found one similar</li>
</ul>
<h3 dir="auto">Superset version</h3>
<p dir="auto">0.19.0</p>
<h3 dir="auto">Expected results</h3>
<p dir="auto">There are a large number of Issues asking about adding new Datasources / Connectors:</p>
<ol dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="149700715" data-permission-text="Title is private" data-url="https://github.com/apache/superset/issues/381" data-hovercard-type="issue" data-hovercard-url="/apache/superset/issues/381/hovercard" href="https://github.com/apache/superset/issues/381">#381</a></li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="230200564" data-permission-text="Title is private" data-url="https://github.com/apache/superset/issues/2790" data-hovercard-type="issue" data-hovercard-url="/apache/superset/issues/2790/hovercard" href="https://github.com/apache/superset/issues/2790">#2790</a></li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="216836093" data-permission-text="Title is private" data-url="https://github.com/apache/superset/issues/2468" data-hovercard-type="issue" data-hovercard-url="/apache/superset/issues/2468/hovercard" href="https://github.com/apache/superset/issues/2468">#2468</a></li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="171152117" data-permission-text="Title is private" data-url="https://github.com/apache/superset/issues/945" data-hovercard-type="issue" data-hovercard-url="/apache/superset/issues/945/hovercard" href="https://github.com/apache/superset/issues/945">#945</a></li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="145361163" data-permission-text="Title is private" data-url="https://github.com/apache/superset/issues/241" data-hovercard-type="issue" data-hovercard-url="/apache/superset/issues/241/hovercard" href="https://github.com/apache/superset/issues/241">#241</a></li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="159692666" data-permission-text="Title is private" data-url="https://github.com/apache/superset/issues/600" data-hovercard-type="issue" data-hovercard-url="/apache/superset/issues/600/hovercard" href="https://github.com/apache/superset/issues/600">#600</a></li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="145501812" data-permission-text="Title is private" data-url="https://github.com/apache/superset/issues/245" data-hovercard-type="issue" data-hovercard-url="/apache/superset/issues/245/hovercard" href="https://github.com/apache/superset/issues/245">#245</a></li>
</ol>
<p dir="auto">Unfortunately, I can't find any examples of a working third party datasource / connector on Github and I think this is possibly because of the complexity and level of effort required to implement a BaseDatasource subclass with all the required methods. In particular, it needs to be able to report the schema and do filtering, grouping and aggregating.</p>
<p dir="auto">Pandas has great import code, and I have seen Pandas proposed an a method for implementing a CSV connector - see <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="149700715" data-permission-text="Title is private" data-url="https://github.com/apache/superset/issues/381" data-hovercard-type="issue" data-hovercard-url="/apache/superset/issues/381/hovercard" href="https://github.com/apache/superset/issues/381">#381</a> - read the CSV using Pandas and then output to sqlite and then connect to sqlite using the SQLA Datasource to create the slices.</p>
<p dir="auto">This approach could be extended to other data formats that Pandas can read, e.g. Excel, HDF5, etc.</p>
<p dir="auto">However, it is not ideal because the sqlite file will be potentially be out of date as soon as it is loaded.</p>
<p dir="auto">I'd like to propose an altenative: a PandasDatasource that allows the user to specify the import method (<code class="notranslate">read_csv</code>, <code class="notranslate">read_table</code>, <code class="notranslate">read_hdf</code>, etc.) and a URL and which then queries the URL using the method to create a Dataframe. It reports the columns available and their types based on the dtypes for the Dataframe. And by default it allows grouping, filtering and aggregating using Pandas built in functionality.</p>
<p dir="auto">I realize that this approach won't work for very large datasets that could overwhelm the memory of the server, but it would work for my use case and probably for many others. The results of the read, filter, group and aggregate would be cached anyway, so the large memory usage is potentially only temporary.</p>
<p dir="auto">This would also make it very much easier for people working with larger datasets to create a custom connector to suit their purposes. For example, someone wanting to use BigQuery (see <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="171152117" data-permission-text="Title is private" data-url="https://github.com/apache/superset/issues/945" data-hovercard-type="issue" data-hovercard-url="/apache/superset/issues/945/hovercard" href="https://github.com/apache/superset/issues/945">#945</a>) could extend the PandasDatasource to use <code class="notranslate">read_gbq</code> and to pass the filter options through to BigQuery but still rely on Pandas to do grouping and aggregating. Given that starting point, someone else might come along later and add the additional code necessary to pass some group options through to BigQuery.</p>
<p dir="auto">The point is that instead of having to write an entire Datasource and implement all methods, you could extend an existing one to scratch your particular itch, and over time as more itches get scratched we would end up with a much broader selection of datasources for Superset.</p>