Repository navigation
fix: loading examples in CI returns http error "too many requests" - #33412
Conversation
Recently in #33354 I tried to address http 429 "too many attempts that we started getting in CI. This PR adds a bit of custom logic with retries and expodential backoffs to work around the issue. Ideally we'd have another approach using a proper CDN that supports our needs or use a github repo to clone locally, but this should help relieve the issue.
There was a problem hiding this comment.
Review by Korbit AI
Korbit automatically attempts to detect when you fix issues in new commits.
| Category | Issue | Status |
|---|---|---|
| Incorrect Data Source for Airports ▹ view | ✅ Fix detected | |
| Excessive Base Wait Time in Backoff Strategy ▹ view | 🧠 Not in scope | |
| Fragmented string formatting in retry message ▹ view |
Files scanned
| File Path | Reviewed |
|---|---|
| superset/examples/paris.py | ✅ |
| superset/examples/sf_population_polygons.py | ✅ |
| superset/examples/bart_lines.py | ✅ |
| superset/examples/random_time_series.py | ✅ |
| superset/examples/flights.py | ✅ |
| superset/examples/country_map.py | ✅ |
| superset/examples/energy.py | ✅ |
| superset/examples/long_lat.py | ✅ |
| superset/examples/multiformat_time_series.py | ✅ |
| superset/examples/helpers.py | ✅ |
| superset/examples/world_bank.py | ✅ |
| superset/examples/birth_names.py | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Check out our docs on how you can make Korbit work best for you and your team.
| def read_example_csv( | ||
| filepath: str, | ||
| max_attempts: int = 5, | ||
| wait_seconds: float = 60, |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
| print( | ||
| f"HTTP 429 received from {url}. ", | ||
| f"Retrying in {sleep_time:.1f}s ", | ||
| "(attempt {attempt}/{max_attempts})...", | ||
| ) |
There was a problem hiding this comment.
Fragmented string formatting in retry message 
Tell me more
What is the issue?
Using concatenated print statements makes the retry message harder to read and maintain. The f-strings are split unnecessarily across multiple lines.
Why this matters
Split string formatting makes the message structure harder to follow and introduces potential formatting inconsistencies. Single f-string would be clearer.
Suggested change ∙ Feature Preview
print(f"HTTP 429 received from {url}. Retrying in {sleep_time:.1f}s (attempt {attempt}/{max_attempts})...")Provide feedback to improve future suggestions
💬 Looking for more details? Reply to this comment to chat with Korbit.
| airports = read_example_csv( | ||
| "flight_data.csv.gz", encoding="latin-1", compression="gzip" | ||
| ) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
@mistercrunch Why do we need this follow-up? Didn't the previous one fix the issue? I'm just asking to know if I need to cherry-pick this into 5.0 like I did with the previous one. |
|
seems it helped - went from seeing a lot of 429 in CI to much fewer, but there are still issues with it. Not sure if this fix fully fixes things either, working on yet another follow up. |
Recently in #33354 I tried to address http 429 "too many attempts that we started getting in CI. This PR adds a bit of custom logic with retries and expodential backoffs to work around the issue. Ideally we'd have another approach using a proper CDN that supports our needs or use a github repo to clone locally, but this should help relieve the issue.
Regardless of the approach, having a central function
examples.helpers.read_example_csvis a step in the right direction as it centralizes the logic used to load the csv into a single DRY place.