Skip to content

Commit

Permalink
fix(explore): don't apply time range filter to Samples table (#17711)
Browse files Browse the repository at this point in the history
  • Loading branch information
kgabryje committed Dec 10, 2021
1 parent 8de9387 commit b5b6ceb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,12 @@ export const DataTablesPane = ({
useEffect(() => {
if (queriesResponse && chartStatus === 'success') {
const { colnames } = queriesResponse[0];
setColumnNames({
...columnNames,
setColumnNames(prevColumnNames => ({
...prevColumnNames,
[RESULT_TYPES.results]: colnames ? [...colnames] : [],
});
}));
}
}, [queriesResponse]);
}, [queriesResponse, chartStatus]);

useEffect(() => {
if (panelOpen && isRequestPending[RESULT_TYPES.results]) {
Expand Down
2 changes: 2 additions & 0 deletions superset/common/query_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ def _get_samples(
query_obj.metrics = []
query_obj.post_processing = []
query_obj.columns = [o.column_name for o in datasource.columns]
query_obj.from_dttm = None
query_obj.to_dttm = None
return _get_full(query_context, query_obj, force_cached)


Expand Down
2 changes: 2 additions & 0 deletions superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ def get_samples(self) -> List[Dict[str, Any]]:
"orderby": [],
"row_limit": config["SAMPLES_ROW_LIMIT"],
"columns": [o.column_name for o in self.datasource.columns],
"from_dttm": None,
"to_dttm": None,
}
)
df = self.get_df_payload(query_obj)["df"] # leverage caching logic
Expand Down

0 comments on commit b5b6ceb

Please sign in to comment.