Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* New option `--verbose` for the `datasets ls` command which lists every
relevant metadata field for the listed datasets.
* New output format option for printing CSV: `--format=csv`.
* Better error messages for status traces that never finish in `status --watch`.
* Improved SIGPIPE handling so that `okdata` works better with tools
such as `head`.

Expand Down
12 changes: 11 additions & 1 deletion okdata/cli/commands/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,23 @@ def wait_until_done(self, trace_id):
if trace_status != "FINISHED":
print("Waiting for processing to finish", end="", flush=True)

while trace_status != "FINISHED":
attempts = 0
max_attempts = 100
while trace_status != "FINISHED" and attempts < max_attempts:
print(".", end="", flush=True)
sleep(2)
attempts += 1
trace_events = self.get_trace_events(trace_id)
trace_status = StatusCommand.find_latest_event(trace_events)["trace_status"]
print()

if attempts == max_attempts:
print(
"\nWe've waited for a good while now, and processing hasn't "
"yet finished.\nSomething else is most likely wrong, maybe a "
"pipeline hasn't been configured for the dataset?\n"
)

return trace_events

def status_for_id(self, trace_id):
Expand Down