Skip to content

fix(datasets): improve Dataset.generate polling robustness and timeout handling#494

Draft
thiagobomfin-galileo wants to merge 1 commit intomainfrom
fix/sc-55368/error-handling-dataset
Draft

fix(datasets): improve Dataset.generate polling robustness and timeout handling#494
thiagobomfin-galileo wants to merge 1 commit intomainfrom
fix/sc-55368/error-handling-dataset

Conversation

@thiagobomfin-galileo
Copy link
Contributor

@thiagobomfin-galileo thiagobomfin-galileo commented Mar 6, 2026

User description

Shortcut:
NewSDK: extend() and generate() do NOT work
Description:

Summary

  • Fix premature loop exit when steps_total=0 on the first poll of a synthetic dataset
    extension job, which caused Dataset.generate to return empty rows
  • Replace fragile "Unexpected error" string matching on progress_message with stall
    detection: raises DatasetAPIException if steps_completed doesn't advance for 30 consecutive
    seconds
  • Add timeout_seconds parameter (default 300s) to Datasets.extend, Dataset.generate, and
    the extend_dataset convenience function, replacing a hardcoded constant and preventing
    infinite polling loops
  • Add a TODO to track replacing stall detection with a proper status/error field once the
    API exposes one in JobProgress
  • Update docstrings across datasets.py and dataset.py to reflect new parameters and
    exception behavior

Test plan

  • Call Dataset.generate(...) against a live environment and verify rows are returned
    correctly
  • Verify a job that returns steps_total=0 on the first poll does not prematurely return
    empty rows
  • Verify a stalled job raises DatasetAPIException with a meaningful message after 30s of no
    progress
  • Verify a timed-out job raises DatasetAPIException after timeout_seconds
  • Verify passing a custom timeout_seconds is respected
  • Run poetry run pytest tests/test_datasets.py — all extend-related tests pass

Tests:

  • Unit Tests Added
  • E2E Test Added (if it's a user-facing feature, or fixing a bug)

Generated description

Below is a concise technical summary of the changes proposed in this PR:
Harden the Datasets.extend and extend_dataset polling loop with timeout, stall detection, and updated docstrings so synthetic extension jobs no longer return empty rows and surface DatasetAPIException when stalled. Teach Dataset.generate to forward the same timeout_seconds contract so callers receive generated rows instead of empty lists, with regression tests covering zero-step starts, stalls, and timeouts.

TopicDetails
Generation flow Teach Dataset.generate to pass through timeout_seconds so that generated rows respect the new polling contract.
Modified files (1)
  • src/galileo/__future__/dataset.py
Latest Contributors(1)
UserCommitDate
vamaq@users.noreply.gi...fix-dataset-204-respon...February 07, 2026
Synthetic extension Harden the extend polling loop by logging progress, adding timeout_seconds, detecting 30s stalls before raising DatasetAPIException, and documenting the new behavior, with regression tests covering zero-step starts, timeouts, and stalls.
Modified files (2)
  • src/galileo/datasets.py
  • tests/test_datasets.py
Latest Contributors(2)
UserCommitDate
bipin@galileo.aifix-normalize-ground_t...February 18, 2026
vamaq@users.noreply.gi...fix-dataset-204-respon...February 07, 2026
This pull request is reviewed by Baz. Review like a pro on (Baz).

@thiagobomfin-galileo thiagobomfin-galileo requested a review from a team as a code owner March 6, 2026 14:44
@thiagobomfin-galileo thiagobomfin-galileo self-assigned this Mar 6, 2026
@codecov
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.03%. Comparing base (5a7c747) to head (753441b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #494      +/-   ##
==========================================
+ Coverage   82.00%   82.03%   +0.02%     
==========================================
  Files          96       96              
  Lines        9260     9273      +13     
==========================================
+ Hits         7594     7607      +13     
  Misses       1666     1666              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@thiagobomfin-galileo thiagobomfin-galileo force-pushed the fix/sc-55368/error-handling-dataset branch from de47abb to 753441b Compare March 6, 2026 16:38
@thiagobomfin-galileo thiagobomfin-galileo marked this pull request as draft March 9, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant