fix: loading examples in CI returns http error "too many requests" (#33412)

This commit is contained in:
Maxime Beauchemin
2025-05-13 08:36:12 -07:00
committed by GitHub
parent 21ca26acd7
commit 7f14e434c8
12 changed files with 71 additions and 41 deletions

View File

@@ -26,10 +26,10 @@ from superset.sql_parse import Table
from superset.utils.core import DatasourceType
from .helpers import (
get_example_url,
get_slice_json,
get_table_connector_registry,
merge_slice,
read_example_data,
)
logger = logging.getLogger(__name__)
@@ -46,8 +46,7 @@ def load_random_time_series_data(
table_exists = database.has_table(Table(tbl_name, schema))
if not only_metadata and (not table_exists or force):
url = get_example_url("random_time_series.json.gz")
pdf = pd.read_json(url, compression="gzip")
pdf = read_example_data("random_time_series.json.gz", compression="gzip")
if database.backend == "presto":
pdf.ds = pd.to_datetime(pdf.ds, unit="s")
pdf.ds = pdf.ds.dt.strftime("%Y-%m-%d %H:%M%:%S")