Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sql lab] simplify the visualize flow #5523

Merged
merged 3 commits into from Aug 2, 2018

Conversation

mistercrunch
Copy link
Member

@mistercrunch mistercrunch commented Jul 30, 2018

The "visualize flow" linking SQL Lab to the "explore view" has never worked so great for people, the current flow is heavy and unintuitive. Now that we have the MetricsControl there's less need to define the metrics upfront.

This new flow sends the user straight to the explore view using the table view with all columns (not grouped)

screen shot 2018-07-30 at 12 47 14 pm

screen shot 2018-07-30 at 12 47 36 pm

screen shot 2018-07-30 at 12 47 22 pm

The "visualize flow" linking SQL Lab to the "explore view" has never
worked so great for people, here's a list of issues:

* it's not really clear to users that their query is wrapped as a
subquery, and the explore view runs queries on top of it
@mistercrunch mistercrunch force-pushed the viz_flow branch 2 times, most recently from 706242c to 009028d Compare July 31, 2018 15:56
@codecov-io
Copy link

codecov-io commented Jul 31, 2018

Codecov Report

Merging #5523 into master will decrease coverage by 0.14%.
The diff coverage is 87.87%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5523      +/-   ##
==========================================
- Coverage   63.29%   63.14%   -0.15%     
==========================================
  Files         349      349              
  Lines       22151    22124      -27     
  Branches     2459     2452       -7     
==========================================
- Hits        14020    13970      -50     
- Misses       8117     8140      +23     
  Partials       14       14
Impacted Files Coverage Δ
superset/assets/src/SqlLab/constants.js 100% <ø> (ø) ⬆️
superset/assets/src/explore/visTypes.jsx 57.14% <ø> (ø) ⬆️
...uperset/assets/src/SqlLab/components/SouthPane.jsx 88.57% <ø> (ø) ⬆️
...perset/assets/src/SqlLab/components/QueryTable.jsx 84.05% <ø> (-0.23%) ⬇️
.../assets/src/SqlLab/components/TabbedSqlEditors.jsx 90.99% <ø> (ø) ⬆️
superset/db_engine_specs.py 55.4% <ø> (+0.13%) ⬆️
superset/views/core.py 74.09% <100%> (-0.09%) ⬇️
superset/models/core.py 87.04% <100%> (+0.09%) ⬆️
...uperset/assets/src/SqlLab/components/ResultSet.jsx 84.21% <85.71%> (-0.64%) ⬇️
...ets/src/SqlLab/components/ExploreResultsButton.jsx 87.17% <87.17%> (ø)
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c1e6c68...4eb119b. Read the comment docs.

@mistercrunch mistercrunch changed the title [WiP] [sql lab] simplify the visualize flow [sql lab] simplify the visualize flow Jul 31, 2018
this.state = {
hints: [],
};
this.visualize = this.visualize.bind(this);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you can use autobind-decorators here

https://github.com/andreypopp/autobind-decorator

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should introduce this decorator and attack the whole repo with it. In the meantime we have one less dependency and consistent-ish code (we have some binding done outside the constructors in many places...)

return datasourceName;
}
buildVizOptions() {
const { schema, sql, dbId, templateParams } = this.props.query;
Copy link
Member

@hughhhh hughhhh Aug 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

return {
    ...this.props.query,
    datasourceName: this.datasourceName(),
    columns: this.getColumns(),
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are lots of other keys in the query object we may not want to send over though :(

@@ -2201,8 +2202,9 @@ def sync_druid_source(self):
def sqllab_viz(self):
SqlaTable = ConnectorRegistry.sources['table']
data = json.loads(request.form.get('data'))
from pprint import pprint
pprint(data)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove pprint

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops

@betodealmeida
Copy link
Member

Nice, I really like the touch of the timeout dialog.

@mistercrunch
Copy link
Member Author

@betodealmeida @hughhhh I addressed most comments

Copy link
Member

@betodealmeida betodealmeida left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@mistercrunch mistercrunch merged commit fe6846b into apache:master Aug 2, 2018
@mistercrunch mistercrunch deleted the viz_flow branch August 2, 2018 17:52
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Aug 3, 2018
* [sql lab] simplify the visualize flow

The "visualize flow" linking SQL Lab to the "explore view" has never
worked so great for people, here's a list of issues:

* it's not really clear to users that their query is wrapped as a
subquery, and the explore view runs queries on top of it

* lint + fix tests

* Addressing comments

(cherry picked from commit fe6846b)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Aug 3, 2018
* [sql lab] simplify the visualize flow

The "visualize flow" linking SQL Lab to the "explore view" has never
worked so great for people, here's a list of issues:

* it's not really clear to users that their query is wrapped as a
subquery, and the explore view runs queries on top of it

* lint + fix tests

* Addressing comments

(cherry picked from commit fe6846b)
(cherry picked from commit 5ba60d9)
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
* [sql lab] simplify the visualize flow

The "visualize flow" linking SQL Lab to the "explore view" has never
worked so great for people, here's a list of issues:

* it's not really clear to users that their query is wrapped as a
subquery, and the explore view runs queries on top of it

* lint + fix tests

* Addressing comments
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants