Skip to content

Commit b6aba71

Browse files
Interactive job display
1 parent 700a287 commit b6aba71

File tree

9 files changed

+680
-12
lines changed

9 files changed

+680
-12
lines changed

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.44.0] - 2025-09-18
11+
12+
### Added
13+
14+
- `tilebox-workflows`: Added `progress_indicators` to the query response of `JobClient.find` to provide programmatic
15+
access to a job's progress indicators.
16+
- `tilebox-workflows`: Added an `ipywidgets` based interactive display for Job objects for interactive environments like
17+
Jupyter notebooks.
18+
1019
## [0.43.0] - 2025-09-12
1120

21+
### Added
22+
1223
- `tilebox-workflows`: Added progress tracking support to the `TaskRunner`.
1324

1425
## [0.42.0] - 2025-08-22
@@ -255,7 +266,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
255266
- Released under the [MIT](https://opensource.org/license/mit) license.
256267
- Released packages: `tilebox-datasets`, `tilebox-workflows`, `tilebox-storage`, `tilebox-grpc`
257268

258-
[Unreleased]: https://github.com/tilebox/tilebox-python/compare/v0.43.0...HEAD
269+
[Unreleased]: https://github.com/tilebox/tilebox-python/compare/v0.44.0...HEAD
270+
[0.44.0]: https://github.com/tilebox/tilebox-python/compare/v0.43.0...v0.44.0
259271
[0.43.0]: https://github.com/tilebox/tilebox-python/compare/v0.42.0...v0.43.0
260272
[0.42.0]: https://github.com/tilebox/tilebox-python/compare/v0.41.0...v0.42.0
261273
[0.41.0]: https://github.com/tilebox/tilebox-python/compare/v0.40.0...v0.41.0

tilebox-workflows/pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ dependencies = [
3030
"tenacity>=8",
3131
"boto3>=1.33",
3232
"boto3-stubs[essential]>=1.33",
33+
"ipywidgets>=8.1.7",
34+
"python-dateutil>=2.9.0.post0",
3335
]
3436

3537
[dependency-groups]

tilebox-workflows/tilebox/workflows/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
from loguru import logger
55

66
from tilebox.workflows.client import Client
7+
from tilebox.workflows.data import Job
78
from tilebox.workflows.task import ExecutionContext, Task
89

9-
__all__ = ["Client", "ExecutionContext", "Task"]
10+
__all__ = ["Client", "ExecutionContext", "Job", "Task"]
1011

1112

1213
def _init_logging(level: str = "INFO") -> None:

tilebox-workflows/tilebox/workflows/data.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import re
22
import warnings
3+
from collections.abc import Callable
34
from dataclasses import dataclass, field
45
from datetime import datetime, timedelta
56
from enum import Enum
67
from functools import lru_cache
78
from pathlib import Path
9+
from typing import Any
810
from uuid import UUID
911

1012
import boto3
@@ -195,7 +197,7 @@ class JobState(Enum):
195197
_JOB_STATES = {state.value: state for state in JobState}
196198

197199

198-
@dataclass(order=True)
200+
@dataclass(order=True, frozen=True)
199201
class Job:
200202
id: UUID
201203
name: str
@@ -207,7 +209,9 @@ class Job:
207209
progress: list[ProgressIndicator]
208210

209211
@classmethod
210-
def from_message(cls, job: core_pb2.Job) -> "Job": # lets use typing.Self once we require python >= 3.11
212+
def from_message(
213+
cls, job: core_pb2.Job, **extra_kwargs: Any
214+
) -> "Job": # lets use typing.Self once we require python >= 3.11
211215
"""Convert a Job protobuf message to a Job object."""
212216
return cls(
213217
id=uuid_message_to_uuid(job.id),
@@ -218,6 +222,7 @@ def from_message(cls, job: core_pb2.Job) -> "Job": # lets use typing.Self once
218222
started_at=timestamp_to_datetime(job.started_at) if job.HasField("started_at") else None,
219223
canceled=job.canceled,
220224
progress=[ProgressIndicator.from_message(progress) for progress in job.progress],
225+
**extra_kwargs,
221226
)
222227

223228
def to_message(self) -> core_pb2.Job:
@@ -571,9 +576,13 @@ class QueryJobsResponse:
571576
next_page: Pagination
572577

573578
@classmethod
574-
def from_message(cls, page: job_pb2.QueryJobsResponse) -> "QueryJobsResponse":
579+
def from_message(
580+
cls,
581+
page: job_pb2.QueryJobsResponse,
582+
job_factory: Callable[[core_pb2.Job], Job] = Job.from_message,
583+
) -> "QueryJobsResponse":
575584
return cls(
576-
jobs=[Job.from_message(job) for job in page.jobs],
585+
jobs=[job_factory(job) for job in page.jobs],
577586
next_page=Pagination.from_message(page.next_page),
578587
)
579588

tilebox-workflows/tilebox/workflows/formatting/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)