Skip to content

Commit

Permalink
fix: Optimize fetching samples logic (apache#26060)
Browse files Browse the repository at this point in the history
  • Loading branch information
john-bodley authored and josedev-union committed Jan 22, 2024
1 parent 83ee9c4 commit 99e3e40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion superset/views/datasource/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def get_samples( # pylint: disable=too-many-arguments,too-many-locals
sample_data = samples_instance.get_payload()["queries"][0]

if sample_data.get("status") == QueryStatus.FAILED:
QueryCacheManager.delete(sample_data.get("cache_key"), CacheRegion.DATA)
QueryCacheManager.delete(count_star_data.get("cache_key"), CacheRegion.DATA)
raise DatasetSamplesFailedError(sample_data.get("error"))

sample_data["page"] = page
Expand Down

0 comments on commit 99e3e40

Please sign in to comment.