mirror of
https://github.com/apache/superset.git
synced 2026-04-20 08:34:37 +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
@@ -23,7 +23,7 @@ import superset.utils.database as database_utils
|
||||
from superset import db
|
||||
from superset.sql_parse import Table
|
||||
|
||||
from .helpers import get_example_url, get_table_connector_registry
|
||||
from .helpers import get_table_connector_registry, read_example_data
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -37,12 +37,14 @@ def load_flights(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):
|
||||
flight_data_url = get_example_url("flight_data.csv.gz")
|
||||
pdf = pd.read_csv(flight_data_url, encoding="latin-1", compression="gzip")
|
||||
pdf = read_example_data(
|
||||
"flight_data.csv.gz", encoding="latin-1", compression="gzip"
|
||||
)
|
||||
|
||||
# Loading airports info to join and get lat/long
|
||||
airports_url = get_example_url("airports.csv.gz")
|
||||
airports = pd.read_csv(airports_url, encoding="latin-1", compression="gzip")
|
||||
airports = read_example_data(
|
||||
"airports.csv.gz", encoding="latin-1", compression="gzip"
|
||||
)
|
||||
airports = airports.set_index("IATA_CODE")
|
||||
|
||||
pdf[ # pylint: disable=unsupported-assignment-operation,useless-suppression
|
||||
|
||||
Reference in New Issue
Block a user