Skip to content

Commit 80122b7

Browse files
Update to latest protobuf messages
1 parent f01ac2e commit 80122b7

16 files changed

Lines changed: 818 additions & 120 deletions

File tree

tilebox-datasets/tilebox/datasets/tilebox/v1/query_pb2.py

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tilebox-datasets/tilebox/datasets/tilebox/v1/query_pb2.pyi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
from tilebox.datasets.buf.validate import validate_pb2 as _validate_pb2
22
from google.protobuf import timestamp_pb2 as _timestamp_pb2
33
from tilebox.datasets.tilebox.v1 import id_pb2 as _id_pb2
4+
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
45
from google.protobuf import descriptor as _descriptor
56
from google.protobuf import message as _message
67
from collections.abc import Mapping as _Mapping
78
from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union
89

910
DESCRIPTOR: _descriptor.FileDescriptor
1011

12+
class SortDirection(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
13+
__slots__ = ()
14+
SORT_DIRECTION_UNSPECIFIED: _ClassVar[SortDirection]
15+
SORT_DIRECTION_ASCENDING: _ClassVar[SortDirection]
16+
SORT_DIRECTION_DESCENDING: _ClassVar[SortDirection]
17+
SORT_DIRECTION_UNSPECIFIED: SortDirection
18+
SORT_DIRECTION_ASCENDING: SortDirection
19+
SORT_DIRECTION_DESCENDING: SortDirection
20+
1121
class TimeInterval(_message.Message):
1222
__slots__ = ("start_time", "end_time", "start_exclusive", "end_inclusive")
1323
START_TIME_FIELD_NUMBER: _ClassVar[int]

tilebox-workflows/tests/clusters/test_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
from tilebox.workflows.data import (
1111
Cluster,
1212
)
13-
from tilebox.workflows.workflows.v1.core_pb2 import Cluster as ClusterMessage
13+
from tilebox.workflows.workflows.v1.workflows_pb2 import (
14+
Cluster as ClusterMessage,
15+
)
1416
from tilebox.workflows.workflows.v1.workflows_pb2 import (
1517
CreateClusterRequest,
1618
DeleteClusterRequest,

tilebox-workflows/tilebox/workflows/data.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
from tilebox.datasets.sync.client import Client as DatasetsClient
4040
from tilebox.workflows.observability.tracing import NoopWorkflowTracer, WorkflowTracer
4141
from tilebox.workflows.workflows.v1 import automation_pb2 as automation_pb
42-
from tilebox.workflows.workflows.v1 import core_pb2, job_pb2, task_pb2
42+
from tilebox.workflows.workflows.v1 import core_pb2, job_pb2, task_pb2, workflows_pb2
4343

4444
_VERSION_PATTERN = re.compile(r"^v(\d+)\.(\d+)$") # matches a version string in the format "v3.2"
4545

@@ -323,13 +323,13 @@ class Cluster:
323323
deletable: bool
324324

325325
@classmethod # lets use typing.Self once we require python >= 3.11
326-
def from_message(cls, cluster: core_pb2.Cluster) -> "Cluster":
326+
def from_message(cls, cluster: workflows_pb2.Cluster) -> "Cluster":
327327
"""Convert a Cluster protobuf message to a Cluster object."""
328328
return cls(slug=cluster.slug, display_name=cluster.display_name, deletable=cluster.deletable)
329329

330-
def to_message(self) -> core_pb2.Cluster:
330+
def to_message(self) -> workflows_pb2.Cluster:
331331
"""Convert a Cluster object to a Cluster protobuf message."""
332-
return core_pb2.Cluster(slug=self.slug, display_name=self.display_name, deletable=self.deletable)
332+
return workflows_pb2.Cluster(slug=self.slug, display_name=self.display_name, deletable=self.deletable)
333333

334334

335335
@dataclass

0 commit comments

Comments
 (0)