Skip to content

Commit

Permalink
added explore database for ctas/cvas
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Davis committed Jun 26, 2020
1 parent ece4f6d commit eb93e60
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion superset-frontend/src/SqlLab/components/ResultSet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export default class ResultSet extends React.PureComponent {
<ExploreCtasResultsButton
table={tmpTable}
schema={tmpSchema}
dbId={query.dbId}
dbId={this.props.database.explore_database_visualization_id}
database={this.props.database}
actions={this.props.actions}
/>
Expand Down
5 changes: 5 additions & 0 deletions superset/models/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ def allows_cost_estimate(self) -> bool:
and cost_estimate_enabled
)

@property
def explore_database_visualization_id(self) -> int:
return self.get_extra().get("explore_database_id", self.id)

@property
def data(self) -> Dict[str, Any]:
return {
Expand All @@ -198,6 +202,7 @@ def data(self) -> Dict[str, Any]:
"allow_multi_schema_metadata_fetch": self.allow_multi_schema_metadata_fetch,
"allows_subquery": self.allows_subquery,
"allows_cost_estimate": self.allows_cost_estimate,
"explore_database_visualization_id": self.explore_database_visualization_id,
}

@property
Expand Down
1 change: 1 addition & 0 deletions superset/views/database/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ class DatabaseRestApi(DatabaseMixin, BaseSupersetModelRestApi):
"allow_csv_upload",
"allows_subquery",
"allows_cost_estimate",
"explore_database_visualization_id",
"backend",
"function_names",
]
Expand Down

0 comments on commit eb93e60

Please sign in to comment.