tracdap-runtime 0.6.3__py3-none-any.whl → 0.6.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. tracdap/rt/_exec/context.py +572 -112
  2. tracdap/rt/_exec/dev_mode.py +166 -97
  3. tracdap/rt/_exec/engine.py +120 -9
  4. tracdap/rt/_exec/functions.py +137 -35
  5. tracdap/rt/_exec/graph.py +38 -13
  6. tracdap/rt/_exec/graph_builder.py +120 -9
  7. tracdap/rt/_impl/data.py +183 -52
  8. tracdap/rt/_impl/grpc/tracdap/metadata/data_pb2.py +18 -18
  9. tracdap/rt/_impl/grpc/tracdap/metadata/job_pb2.py +74 -30
  10. tracdap/rt/_impl/grpc/tracdap/metadata/job_pb2.pyi +120 -2
  11. tracdap/rt/_impl/grpc/tracdap/metadata/model_pb2.py +20 -18
  12. tracdap/rt/_impl/grpc/tracdap/metadata/model_pb2.pyi +22 -6
  13. tracdap/rt/_impl/grpc/tracdap/metadata/resource_pb2.py +29 -0
  14. tracdap/rt/_impl/grpc/tracdap/metadata/resource_pb2.pyi +16 -0
  15. tracdap/rt/_impl/models.py +8 -0
  16. tracdap/rt/_impl/static_api.py +42 -10
  17. tracdap/rt/_impl/storage.py +37 -25
  18. tracdap/rt/_impl/validation.py +113 -11
  19. tracdap/rt/_plugins/repo_git.py +1 -1
  20. tracdap/rt/_version.py +1 -1
  21. tracdap/rt/api/experimental.py +220 -0
  22. tracdap/rt/api/hook.py +6 -4
  23. tracdap/rt/api/model_api.py +98 -13
  24. tracdap/rt/api/static_api.py +14 -6
  25. tracdap/rt/config/__init__.py +2 -2
  26. tracdap/rt/config/common.py +23 -17
  27. tracdap/rt/config/job.py +2 -2
  28. tracdap/rt/config/platform.py +25 -25
  29. tracdap/rt/config/result.py +2 -2
  30. tracdap/rt/config/runtime.py +3 -3
  31. tracdap/rt/launch/cli.py +7 -4
  32. tracdap/rt/launch/launch.py +19 -3
  33. tracdap/rt/metadata/__init__.py +25 -20
  34. tracdap/rt/metadata/common.py +2 -2
  35. tracdap/rt/metadata/custom.py +3 -3
  36. tracdap/rt/metadata/data.py +12 -12
  37. tracdap/rt/metadata/file.py +6 -6
  38. tracdap/rt/metadata/flow.py +6 -6
  39. tracdap/rt/metadata/job.py +62 -8
  40. tracdap/rt/metadata/model.py +33 -11
  41. tracdap/rt/metadata/object_id.py +8 -8
  42. tracdap/rt/metadata/resource.py +24 -0
  43. tracdap/rt/metadata/search.py +5 -5
  44. tracdap/rt/metadata/stoarge.py +6 -6
  45. tracdap/rt/metadata/tag.py +1 -1
  46. tracdap/rt/metadata/tag_update.py +1 -1
  47. tracdap/rt/metadata/type.py +4 -4
  48. {tracdap_runtime-0.6.3.dist-info → tracdap_runtime-0.6.5.dist-info}/METADATA +3 -1
  49. {tracdap_runtime-0.6.3.dist-info → tracdap_runtime-0.6.5.dist-info}/RECORD +52 -48
  50. {tracdap_runtime-0.6.3.dist-info → tracdap_runtime-0.6.5.dist-info}/LICENSE +0 -0
  51. {tracdap_runtime-0.6.3.dist-info → tracdap_runtime-0.6.5.dist-info}/WHEEL +0 -0
  52. {tracdap_runtime-0.6.3.dist-info → tracdap_runtime-0.6.5.dist-info}/top_level.txt +0 -0
@@ -54,17 +54,17 @@ class FieldSchema:
54
54
  :class:`TableSchema <TableSchema>`
55
55
  """
56
56
 
57
- fieldName: str = None
57
+ fieldName: str = ""
58
58
 
59
- fieldOrder: int = None
59
+ fieldOrder: int = 0
60
60
 
61
61
  fieldType: BasicType = BasicType.BASIC_TYPE_NOT_SET
62
62
 
63
- label: str = None
63
+ label: str = ""
64
64
 
65
- businessKey: bool = None
65
+ businessKey: bool = False
66
66
 
67
- categorical: bool = None
67
+ categorical: bool = False
68
68
 
69
69
  notNull: _tp.Optional[bool] = None
70
70
 
@@ -110,7 +110,7 @@ class PartKey:
110
110
 
111
111
  """Partition key for tabular datasets"""
112
112
 
113
- opaqueKey: str = None
113
+ opaqueKey: str = ""
114
114
 
115
115
  partType: PartType = PartType.PART_ROOT
116
116
 
@@ -129,23 +129,23 @@ class DataDefinition:
129
129
  @_dc.dataclass
130
130
  class Delta:
131
131
 
132
- deltaIndex: int = None
132
+ deltaIndex: int = 0
133
133
 
134
- dataItem: str = None
134
+ dataItem: str = ""
135
135
 
136
136
  @_dc.dataclass
137
137
  class Snap:
138
138
 
139
- snapIndex: int = None
139
+ snapIndex: int = 0
140
140
 
141
141
  deltas: _tp.List[DataDefinition.Delta] = _dc.field(default_factory=list)
142
142
 
143
143
  @_dc.dataclass
144
144
  class Part:
145
145
 
146
- partKey: PartKey = None
146
+ partKey: PartKey = _dc.field(default_factory=lambda: PartKey())
147
147
 
148
- snap: DataDefinition.Snap = None
148
+ snap: DataDefinition.Snap = _dc.field(default_factory=lambda: DataDefinition.Snap())
149
149
 
150
150
  schemaId: _tp.Optional[TagSelector] = None
151
151
 
@@ -153,4 +153,4 @@ class DataDefinition:
153
153
 
154
154
  parts: _tp.Dict[str, DataDefinition.Part] = _dc.field(default_factory=dict)
155
155
 
156
- storageId: TagSelector = None
156
+ storageId: TagSelector = _dc.field(default_factory=lambda: TagSelector())
@@ -14,14 +14,14 @@ class FileDefinition:
14
14
 
15
15
  """Describes a file object stored in the TRAC platform"""
16
16
 
17
- name: str = None
17
+ name: str = ""
18
18
 
19
- extension: str = None
19
+ extension: str = ""
20
20
 
21
- mimeType: str = None
21
+ mimeType: str = ""
22
22
 
23
- size: int = None
23
+ size: int = 0
24
24
 
25
- storageId: TagSelector = None
25
+ storageId: TagSelector = _dc.field(default_factory=lambda: TagSelector())
26
26
 
27
- dataItem: str = None
27
+ dataItem: str = ""
@@ -59,13 +59,13 @@ class FlowNode:
59
59
 
60
60
  outputs: _tp.List[str] = _dc.field(default_factory=list)
61
61
 
62
- nodeSearch: SearchExpression = None
62
+ nodeSearch: SearchExpression = _dc.field(default_factory=lambda: SearchExpression())
63
63
 
64
64
  nodeAttrs: _tp.List[TagUpdate] = _dc.field(default_factory=list)
65
65
 
66
66
  nodeProps: _tp.Dict[str, Value] = _dc.field(default_factory=dict)
67
67
 
68
- label: str = None
68
+ label: str = ""
69
69
 
70
70
 
71
71
  @_dc.dataclass
@@ -85,9 +85,9 @@ class FlowSocket:
85
85
  :class:`FlowEdge <FlowEdge>`
86
86
  """
87
87
 
88
- node: str = None
88
+ node: str = ""
89
89
 
90
- socket: str = None
90
+ socket: str = ""
91
91
 
92
92
 
93
93
  @_dc.dataclass
@@ -100,9 +100,9 @@ class FlowEdge:
100
100
  :class:`FlowSocket <FlowSocket>`
101
101
  """
102
102
 
103
- source: FlowSocket = None
103
+ source: FlowSocket = _dc.field(default_factory=lambda: FlowSocket())
104
104
 
105
- target: FlowSocket = None
105
+ target: FlowSocket = _dc.field(default_factory=lambda: FlowSocket())
106
106
 
107
107
 
108
108
  @_dc.dataclass
@@ -32,6 +32,10 @@ class JobType(_enum.Enum):
32
32
 
33
33
  """Import data into the platform"""
34
34
 
35
+ EXPORT_DATA = 5
36
+
37
+ """Export data to external locations"""
38
+
35
39
 
36
40
  class JobStatusCode(_enum.Enum):
37
41
 
@@ -93,13 +97,17 @@ class JobDefinition:
93
97
 
94
98
  importModel: _tp.Optional[ImportModelJob] = None
95
99
 
100
+ importData: _tp.Optional[ImportDataJob] = None
101
+
102
+ exportData: _tp.Optional[ExportDataJob] = None
103
+
96
104
 
97
105
  @_dc.dataclass
98
106
  class RunModelJob:
99
107
 
100
108
  """Specification for a RuN_MODEL job"""
101
109
 
102
- model: TagSelector = None
110
+ model: TagSelector = _dc.field(default_factory=lambda: TagSelector())
103
111
 
104
112
  parameters: _tp.Dict[str, Value] = _dc.field(default_factory=dict)
105
113
 
@@ -117,7 +125,7 @@ class RunFlowJob:
117
125
 
118
126
  """Specification for a RUN_FLOW job"""
119
127
 
120
- flow: TagSelector = None
128
+ flow: TagSelector = _dc.field(default_factory=lambda: TagSelector())
121
129
 
122
130
  parameters: _tp.Dict[str, Value] = _dc.field(default_factory=dict)
123
131
 
@@ -137,18 +145,64 @@ class ImportModelJob:
137
145
 
138
146
  """Specification for an IMPORT_MODEL job"""
139
147
 
140
- language: str = None
148
+ language: str = ""
141
149
 
142
- repository: str = None
150
+ repository: str = ""
143
151
 
144
152
  packageGroup: _tp.Optional[str] = None
145
153
 
146
- package: str = None
154
+ package: str = ""
147
155
 
148
- version: str = None
156
+ version: str = ""
149
157
 
150
- entryPoint: str = None
158
+ entryPoint: str = ""
151
159
 
152
- path: str = None
160
+ path: str = ""
153
161
 
154
162
  modelAttrs: _tp.List[TagUpdate] = _dc.field(default_factory=list)
163
+
164
+
165
+ @_dc.dataclass
166
+ class ImportDataJob:
167
+
168
+ """Specification for an IMPORT_DATA job"""
169
+
170
+ model: TagSelector = _dc.field(default_factory=lambda: TagSelector())
171
+
172
+ parameters: _tp.Dict[str, Value] = _dc.field(default_factory=dict)
173
+
174
+ inputs: _tp.Dict[str, TagSelector] = _dc.field(default_factory=dict)
175
+
176
+ outputs: _tp.Dict[str, TagSelector] = _dc.field(default_factory=dict)
177
+
178
+ priorOutputs: _tp.Dict[str, TagSelector] = _dc.field(default_factory=dict)
179
+
180
+ storageAccess: _tp.List[str] = _dc.field(default_factory=list)
181
+
182
+ imports: _tp.Dict[str, TagSelector] = _dc.field(default_factory=dict)
183
+
184
+ outputAttrs: _tp.List[TagUpdate] = _dc.field(default_factory=list)
185
+
186
+ importAttrs: _tp.List[TagUpdate] = _dc.field(default_factory=list)
187
+
188
+
189
+ @_dc.dataclass
190
+ class ExportDataJob:
191
+
192
+ """Specification for an EXPORT_DATA job"""
193
+
194
+ model: TagSelector = _dc.field(default_factory=lambda: TagSelector())
195
+
196
+ parameters: _tp.Dict[str, Value] = _dc.field(default_factory=dict)
197
+
198
+ inputs: _tp.Dict[str, TagSelector] = _dc.field(default_factory=dict)
199
+
200
+ outputs: _tp.Dict[str, TagSelector] = _dc.field(default_factory=dict)
201
+
202
+ priorOutputs: _tp.Dict[str, TagSelector] = _dc.field(default_factory=dict)
203
+
204
+ storageAccess: _tp.List[str] = _dc.field(default_factory=list)
205
+
206
+ exports: _tp.Dict[str, TagSelector] = _dc.field(default_factory=dict)
207
+
208
+ outputAttrs: _tp.List[TagUpdate] = _dc.field(default_factory=list)
@@ -9,15 +9,31 @@ from .type import * # noqa
9
9
  from .data import * # noqa
10
10
 
11
11
 
12
+ class ModelType(_enum.Enum):
13
+
14
+ """Identify specialized model types for specific tasks"""
15
+
16
+ STANDARD_MODEL = 0
17
+
18
+ """A regular model with parameters, inputs and outputs (this is the default)"""
19
+
20
+ DATA_IMPORT_MODEL = 1
21
+
22
+ """A model with read access to external storage for importing data"""
23
+
24
+ DATA_EXPORT_MODEL = 2
25
+
26
+ """A model with write access to external storage for exporting data"""
27
+
12
28
 
13
29
  @_dc.dataclass
14
30
  class ModelParameter:
15
31
 
16
32
  """Describes an individual parameter of a model"""
17
33
 
18
- paramType: TypeDescriptor = None
34
+ paramType: TypeDescriptor = _dc.field(default_factory=lambda: TypeDescriptor())
19
35
 
20
- label: str = None
36
+ label: str = ""
21
37
 
22
38
  defaultValue: _tp.Optional[Value] = None
23
39
 
@@ -39,11 +55,13 @@ class ModelInputSchema:
39
55
  other options may be required. These capabilities may be added in future releases.
40
56
  """
41
57
 
42
- schema: SchemaDefinition = None
58
+ schema: SchemaDefinition = _dc.field(default_factory=lambda: SchemaDefinition())
43
59
 
44
60
  label: _tp.Optional[str] = None
45
61
 
46
- optional: bool = None
62
+ optional: bool = False
63
+
64
+ dynamic: bool = False
47
65
 
48
66
  inputProps: _tp.Dict[str, Value] = _dc.field(default_factory=dict)
49
67
 
@@ -64,11 +82,13 @@ class ModelOutputSchema:
64
82
  added in future releases.
65
83
  """
66
84
 
67
- schema: SchemaDefinition = None
85
+ schema: SchemaDefinition = _dc.field(default_factory=lambda: SchemaDefinition())
68
86
 
69
87
  label: _tp.Optional[str] = None
70
88
 
71
- optional: bool = None
89
+ optional: bool = False
90
+
91
+ dynamic: bool = False
72
92
 
73
93
  outputProps: _tp.Dict[str, Value] = _dc.field(default_factory=dict)
74
94
 
@@ -78,17 +98,17 @@ class ModelDefinition:
78
98
 
79
99
  """Define a model for execution on the TRAC platform"""
80
100
 
81
- language: str = None
101
+ language: str = ""
82
102
 
83
- repository: str = None
103
+ repository: str = ""
84
104
 
85
105
  packageGroup: _tp.Optional[str] = None
86
106
 
87
- package: str = None
107
+ package: str = ""
88
108
 
89
- version: str = None
109
+ version: str = ""
90
110
 
91
- entryPoint: str = None
111
+ entryPoint: str = ""
92
112
 
93
113
  path: _tp.Optional[str] = None
94
114
 
@@ -101,3 +121,5 @@ class ModelDefinition:
101
121
  staticAttributes: _tp.Dict[str, Value] = _dc.field(default_factory=dict)
102
122
 
103
123
  """Static attributes defined in model code"""
124
+
125
+ modelType: ModelType = ModelType.STANDARD_MODEL
@@ -56,7 +56,7 @@ class TagHeader:
56
56
  :class:`ObjectType <ObjectType>`
57
57
  """
58
58
 
59
- objectId: str = None
59
+ objectId: str = ""
60
60
 
61
61
  """
62
62
  Object ID of the object this tag is associated with.
@@ -64,27 +64,27 @@ class TagHeader:
64
64
  Object IDs are UUIDs (RFC4122, https://www.ietf.org/rfc/rfc4122.txt)
65
65
  """
66
66
 
67
- objectVersion: int = None
67
+ objectVersion: int = 0
68
68
 
69
69
  """Version of the object this tag is associated with."""
70
70
 
71
- objectTimestamp: DatetimeValue = None
71
+ objectTimestamp: DatetimeValue = _dc.field(default_factory=lambda: DatetimeValue())
72
72
 
73
73
  """Timestamp for when this version of the object was created."""
74
74
 
75
- tagVersion: int = None
75
+ tagVersion: int = 0
76
76
 
77
77
  """Version of this tag."""
78
78
 
79
- tagTimestamp: DatetimeValue = None
79
+ tagTimestamp: DatetimeValue = _dc.field(default_factory=lambda: DatetimeValue())
80
80
 
81
81
  """Timestamp for when this version of the tag was created."""
82
82
 
83
- isLatestObject: bool = None
83
+ isLatestObject: bool = False
84
84
 
85
85
  """isLatest flag for the object the tag is associated with."""
86
86
 
87
- isLatestTag: bool = None
87
+ isLatestTag: bool = False
88
88
 
89
89
  """isLatest flag for the tag."""
90
90
 
@@ -132,7 +132,7 @@ class TagSelector:
132
132
  :class:`ObjectType <ObjectType>`
133
133
  """
134
134
 
135
- objectId: str = None
135
+ objectId: str = ""
136
136
 
137
137
  """
138
138
  Object ID of the tag being selected.
@@ -0,0 +1,24 @@
1
+ # Code generated by TRAC
2
+
3
+ from __future__ import annotations
4
+ import typing as _tp # noqa
5
+ import dataclasses as _dc # noqa
6
+ import enum as _enum # noqa
7
+
8
+ from .object_id import * # noqa
9
+ from .object import * # noqa
10
+
11
+
12
+ class ResourceType(_enum.Enum):
13
+
14
+ """Enumeration of infrastructure resources that can be added to a tenant"""
15
+
16
+ RESOURCE_TYPE_NOT_SET = 0
17
+
18
+ MODEL_REPOSITORY = 1
19
+
20
+ """Model repository, which can be a source or binary repository"""
21
+
22
+ INTERNAL_STORAGE = 2
23
+
24
+ """Storage location for data held internally by the TRAC platform"""
@@ -175,7 +175,7 @@ class SearchTerm:
175
175
  Applies a search operator against an individual tag attribute.
176
176
  """
177
177
 
178
- attrName: str = None
178
+ attrName: str = ""
179
179
 
180
180
  """The name of the attribute to search for"""
181
181
 
@@ -187,7 +187,7 @@ class SearchTerm:
187
187
 
188
188
  """The search operator to apply"""
189
189
 
190
- searchValue: Value = None
190
+ searchValue: Value = _dc.field(default_factory=lambda: Value())
191
191
 
192
192
  """The search value to look for"""
193
193
 
@@ -244,7 +244,7 @@ class SearchParameters:
244
244
 
245
245
  """The type of object to search for"""
246
246
 
247
- search: SearchExpression = None
247
+ search: SearchExpression = _dc.field(default_factory=lambda: SearchExpression())
248
248
 
249
249
  """
250
250
  A search expression based on tag attributes.
@@ -268,7 +268,7 @@ class SearchParameters:
268
268
  current time.
269
269
  """
270
270
 
271
- priorVersions: bool = None
271
+ priorVersions: bool = False
272
272
 
273
273
  """
274
274
  Include prior versions of objects in the search.
@@ -287,7 +287,7 @@ class SearchParameters:
287
287
  latest tag is considered for each object.
288
288
  """
289
289
 
290
- priorTags: bool = None
290
+ priorTags: bool = False
291
291
 
292
292
  """
293
293
  Include prior tags in the search.
@@ -60,15 +60,15 @@ class StorageCopy:
60
60
  :class:`StorageDefinition <StorageDefinition>`
61
61
  """
62
62
 
63
- storageKey: str = None
63
+ storageKey: str = ""
64
64
 
65
- storagePath: str = None
65
+ storagePath: str = ""
66
66
 
67
- storageFormat: str = None
67
+ storageFormat: str = ""
68
68
 
69
69
  copyStatus: CopyStatus = CopyStatus.COPY_STATUS_NOT_SET
70
70
 
71
- copyTimestamp: DatetimeValue = None
71
+ copyTimestamp: DatetimeValue = _dc.field(default_factory=lambda: DatetimeValue())
72
72
 
73
73
  storageOptions: _tp.Dict[str, Value] = _dc.field(default_factory=dict)
74
74
 
@@ -85,9 +85,9 @@ class StorageIncarnation:
85
85
 
86
86
  copies: _tp.List[StorageCopy] = _dc.field(default_factory=list)
87
87
 
88
- incarnationIndex: int = None
88
+ incarnationIndex: int = 0
89
89
 
90
- incarnationTimestamp: DatetimeValue = None
90
+ incarnationTimestamp: DatetimeValue = _dc.field(default_factory=lambda: DatetimeValue())
91
91
 
92
92
  incarnationStatus: IncarnationStatus = IncarnationStatus.INCARNATION_STATUS_NOT_SET
93
93
 
@@ -78,7 +78,7 @@ class Tag:
78
78
  :class:`ObjectDefinition <ObjectDefinition>`
79
79
  """
80
80
 
81
- header: TagHeader = None
81
+ header: TagHeader = _dc.field(default_factory=lambda: TagHeader())
82
82
 
83
83
  """
84
84
  The tag header uniquely identifies the current tag and the object it is
@@ -109,7 +109,7 @@ class TagUpdate:
109
109
  :class:`TagOperation <TagOperation>`
110
110
  """
111
111
 
112
- attrName: str = None
112
+ attrName: str = ""
113
113
 
114
114
  """
115
115
  Name of the attribute this update refers to.
@@ -127,7 +127,7 @@ class DecimalValue:
127
127
  :class:`DECIMAL <BasicType.DECIMAL>`
128
128
  """
129
129
 
130
- decimal: str = None
130
+ decimal: str = ""
131
131
 
132
132
 
133
133
  @_dc.dataclass
@@ -142,7 +142,7 @@ class DateValue:
142
142
  :class:`DATE <BasicType.DATE>`
143
143
  """
144
144
 
145
- isoDate: str = None
145
+ isoDate: str = ""
146
146
 
147
147
 
148
148
  @_dc.dataclass
@@ -157,7 +157,7 @@ class DatetimeValue:
157
157
  :class:`DATETIME <BasicType.DATETIME>`
158
158
  """
159
159
 
160
- isoDatetime: str = None
160
+ isoDatetime: str = ""
161
161
 
162
162
 
163
163
  @_dc.dataclass
@@ -187,7 +187,7 @@ class Value:
187
187
  :class:`TypeDescriptor <TypeDescriptor>`
188
188
  """
189
189
 
190
- type: TypeDescriptor = None
190
+ type: TypeDescriptor = _dc.field(default_factory=lambda: TypeDescriptor())
191
191
 
192
192
  """
193
193
  Type descriptor for the current value.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tracdap-runtime
3
- Version: 0.6.3
3
+ Version: 0.6.5
4
4
  Summary: Runtime package for building models on the TRAC Data & Analytics Platform
5
5
  Home-page: https://tracdap.finos.org/
6
6
  Author: Martin Traverse
@@ -39,6 +39,8 @@ Requires-Dist: gcsfs==2024.3.1; extra == "gcp"
39
39
  Provides-Extra: grpc
40
40
  Requires-Dist: grpcio==1.66.1; extra == "grpc"
41
41
  Requires-Dist: grpcio-status==1.66.1; extra == "grpc"
42
+ Provides-Extra: polars
43
+ Requires-Dist: polars<2.0.0,>=1.0.0; extra == "polars"
42
44
  Provides-Extra: spark
43
45
  Requires-Dist: pyspark<3.6.0,>=3.0.0; extra == "spark"
44
46