mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
fix: loading examples in CI returns http error "too many requests" (#33412)
This commit is contained in:
committed by
GitHub
parent
21ca26acd7
commit
7f14e434c8
@@ -16,7 +16,6 @@
|
||||
# under the License.
|
||||
import logging
|
||||
|
||||
import pandas as pd
|
||||
import polyline
|
||||
from sqlalchemy import inspect, String, Text
|
||||
|
||||
@@ -25,7 +24,7 @@ from superset.sql_parse import Table
|
||||
from superset.utils import json
|
||||
|
||||
from ..utils.database import get_example_database
|
||||
from .helpers import get_example_url, get_table_connector_registry
|
||||
from .helpers import get_table_connector_registry, read_example_data
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -38,8 +37,9 @@ def load_bart_lines(only_metadata: bool = False, force: bool = False) -> None:
|
||||
table_exists = database.has_table(Table(tbl_name, schema))
|
||||
|
||||
if not only_metadata and (not table_exists or force):
|
||||
url = get_example_url("bart-lines.json.gz")
|
||||
df = pd.read_json(url, encoding="latin-1", compression="gzip")
|
||||
df = read_example_data(
|
||||
"bart-lines.json.gz", encoding="latin-1", compression="gzip"
|
||||
)
|
||||
df["path_json"] = df.path.map(json.dumps)
|
||||
df["polyline"] = df.path.map(polyline.encode)
|
||||
del df["path"]
|
||||
|
||||
Reference in New Issue
Block a user