tracdap-runtime 0.6.5__py3-none-any.whl → 0.7.0rc1__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.
- tracdap/rt/__init__.py +6 -5
- tracdap/rt/_exec/actors.py +6 -5
- tracdap/rt/_exec/context.py +278 -110
- tracdap/rt/_exec/dev_mode.py +237 -143
- tracdap/rt/_exec/engine.py +223 -64
- tracdap/rt/_exec/functions.py +31 -6
- tracdap/rt/_exec/graph.py +15 -5
- tracdap/rt/_exec/graph_builder.py +301 -203
- tracdap/rt/_exec/runtime.py +13 -10
- tracdap/rt/_exec/server.py +6 -5
- tracdap/rt/_impl/__init__.py +6 -5
- tracdap/rt/_impl/config_parser.py +17 -9
- tracdap/rt/_impl/data.py +284 -172
- tracdap/rt/_impl/ext/__init__.py +14 -0
- tracdap/rt/_impl/ext/sql.py +117 -0
- tracdap/rt/_impl/ext/storage.py +58 -0
- tracdap/rt/_impl/grpc/__init__.py +6 -5
- tracdap/rt/_impl/grpc/codec.py +6 -5
- tracdap/rt/_impl/grpc/tracdap/metadata/job_pb2.py +62 -54
- tracdap/rt/_impl/grpc/tracdap/metadata/job_pb2.pyi +37 -2
- tracdap/rt/_impl/guard_rails.py +6 -5
- tracdap/rt/_impl/models.py +6 -5
- tracdap/rt/_impl/repos.py +6 -5
- tracdap/rt/_impl/schemas.py +6 -5
- tracdap/rt/_impl/shim.py +6 -5
- tracdap/rt/_impl/static_api.py +30 -16
- tracdap/rt/_impl/storage.py +8 -7
- tracdap/rt/_impl/type_system.py +6 -5
- tracdap/rt/_impl/util.py +16 -5
- tracdap/rt/_impl/validation.py +72 -18
- tracdap/rt/_plugins/__init__.py +6 -5
- tracdap/rt/_plugins/_helpers.py +6 -5
- tracdap/rt/_plugins/config_local.py +6 -5
- tracdap/rt/_plugins/format_arrow.py +6 -5
- tracdap/rt/_plugins/format_csv.py +6 -5
- tracdap/rt/_plugins/format_parquet.py +6 -5
- tracdap/rt/_plugins/repo_git.py +6 -5
- tracdap/rt/_plugins/repo_local.py +6 -5
- tracdap/rt/_plugins/repo_pypi.py +6 -5
- tracdap/rt/_plugins/storage_aws.py +6 -5
- tracdap/rt/_plugins/storage_azure.py +6 -5
- tracdap/rt/_plugins/storage_gcp.py +6 -5
- tracdap/rt/_plugins/storage_local.py +6 -5
- tracdap/rt/_plugins/storage_sql.py +418 -0
- tracdap/rt/_plugins/storage_sql_dialects.py +118 -0
- tracdap/rt/_version.py +7 -6
- tracdap/rt/api/__init__.py +23 -5
- tracdap/rt/api/experimental.py +85 -37
- tracdap/rt/api/hook.py +16 -5
- tracdap/rt/api/model_api.py +110 -90
- tracdap/rt/api/static_api.py +142 -100
- tracdap/rt/config/common.py +26 -27
- tracdap/rt/config/job.py +5 -6
- tracdap/rt/config/platform.py +41 -42
- tracdap/rt/config/result.py +5 -6
- tracdap/rt/config/runtime.py +6 -7
- tracdap/rt/exceptions.py +13 -7
- tracdap/rt/ext/__init__.py +6 -5
- tracdap/rt/ext/config.py +6 -5
- tracdap/rt/ext/embed.py +6 -5
- tracdap/rt/ext/plugins.py +6 -5
- tracdap/rt/ext/repos.py +6 -5
- tracdap/rt/ext/storage.py +6 -5
- tracdap/rt/launch/__init__.py +10 -5
- tracdap/rt/launch/__main__.py +6 -5
- tracdap/rt/launch/cli.py +6 -5
- tracdap/rt/launch/launch.py +38 -15
- tracdap/rt/metadata/__init__.py +4 -0
- tracdap/rt/metadata/common.py +2 -3
- tracdap/rt/metadata/custom.py +3 -4
- tracdap/rt/metadata/data.py +30 -31
- tracdap/rt/metadata/file.py +6 -7
- tracdap/rt/metadata/flow.py +22 -23
- tracdap/rt/metadata/job.py +89 -45
- tracdap/rt/metadata/model.py +26 -27
- tracdap/rt/metadata/object.py +11 -12
- tracdap/rt/metadata/object_id.py +23 -24
- tracdap/rt/metadata/resource.py +0 -1
- tracdap/rt/metadata/search.py +15 -16
- tracdap/rt/metadata/stoarge.py +22 -23
- tracdap/rt/metadata/tag.py +8 -9
- tracdap/rt/metadata/tag_update.py +11 -12
- tracdap/rt/metadata/type.py +38 -38
- {tracdap_runtime-0.6.5.dist-info → tracdap_runtime-0.7.0rc1.dist-info}/LICENSE +1 -1
- {tracdap_runtime-0.6.5.dist-info → tracdap_runtime-0.7.0rc1.dist-info}/METADATA +4 -2
- tracdap_runtime-0.7.0rc1.dist-info/RECORD +121 -0
- {tracdap_runtime-0.6.5.dist-info → tracdap_runtime-0.7.0rc1.dist-info}/WHEEL +1 -1
- tracdap_runtime-0.6.5.dist-info/RECORD +0 -116
- {tracdap_runtime-0.6.5.dist-info → tracdap_runtime-0.7.0rc1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,117 @@
|
|
1
|
+
# Licensed to the Fintech Open Source Foundation (FINOS) under one or
|
2
|
+
# more contributor license agreements. See the NOTICE file distributed
|
3
|
+
# with this work for additional information regarding copyright ownership.
|
4
|
+
# FINOS licenses this file to you under the Apache License, Version 2.0
|
5
|
+
# (the "License"); you may not use this file except in compliance with the
|
6
|
+
# License. You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
|
16
|
+
import abc as _abc
|
17
|
+
import enum
|
18
|
+
import typing as _tp
|
19
|
+
import contextlib as _cm
|
20
|
+
|
21
|
+
import pyarrow as _pa
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
class ISqlDialect:
|
26
|
+
|
27
|
+
@_abc.abstractmethod
|
28
|
+
def arrow_to_sql_type(self, arrow_type: _pa.DataType) -> str:
|
29
|
+
pass
|
30
|
+
|
31
|
+
|
32
|
+
class ISqlDriver:
|
33
|
+
|
34
|
+
@_abc.abstractmethod
|
35
|
+
def param_style(self) -> "DbApiWrapper.ParamStyle":
|
36
|
+
pass
|
37
|
+
|
38
|
+
@_abc.abstractmethod
|
39
|
+
def connect(self, **kwargs) -> "DbApiWrapper.Connection":
|
40
|
+
pass
|
41
|
+
|
42
|
+
@_abc.abstractmethod
|
43
|
+
def has_table(self, table_name: str) -> bool:
|
44
|
+
pass
|
45
|
+
|
46
|
+
@_abc.abstractmethod
|
47
|
+
def list_tables(self) -> _tp.List[str]:
|
48
|
+
pass
|
49
|
+
|
50
|
+
@_abc.abstractmethod
|
51
|
+
def error_handling(self) -> _cm.contextmanager:
|
52
|
+
pass
|
53
|
+
|
54
|
+
@_abc.abstractmethod
|
55
|
+
def encode_sql_value(self, py_value: _tp.Any) -> _tp.Any:
|
56
|
+
pass
|
57
|
+
|
58
|
+
@_abc.abstractmethod
|
59
|
+
def decode_sql_value(self, sql_value: _tp.Any, python_type: _tp.Type) -> _tp.Any:
|
60
|
+
pass
|
61
|
+
|
62
|
+
|
63
|
+
class DbApiWrapper:
|
64
|
+
|
65
|
+
class ThreadSafety(enum.Enum):
|
66
|
+
NOT_THREAD_SAFE = 0
|
67
|
+
MODULE_SAFE = 1
|
68
|
+
CONNECTION_SAFE = 2
|
69
|
+
CURSOR_SAFE = 3
|
70
|
+
|
71
|
+
class ParamStyle(enum.Enum):
|
72
|
+
QMARK = "qmark"
|
73
|
+
NUMERIC = "numeric"
|
74
|
+
NAMED = "named"
|
75
|
+
FORMAT = "format"
|
76
|
+
PYFORMAT = "pyformat"
|
77
|
+
|
78
|
+
class Connection(_tp.Protocol):
|
79
|
+
|
80
|
+
def close(self):
|
81
|
+
pass
|
82
|
+
|
83
|
+
def commit(self):
|
84
|
+
pass
|
85
|
+
|
86
|
+
def rollback(self):
|
87
|
+
pass
|
88
|
+
|
89
|
+
def cursor(self) -> "DbApiWrapper.Cursor":
|
90
|
+
pass
|
91
|
+
|
92
|
+
class Cursor(_tp.Protocol):
|
93
|
+
|
94
|
+
arraysize: int = 1
|
95
|
+
|
96
|
+
@property
|
97
|
+
def description(self) -> tuple:
|
98
|
+
pass
|
99
|
+
|
100
|
+
@property
|
101
|
+
def rowcount(self) -> int:
|
102
|
+
pass
|
103
|
+
|
104
|
+
def execute(self, operation: str, parameters: _tp.Union[_tp.Dict, _tp.Sequence]):
|
105
|
+
pass
|
106
|
+
|
107
|
+
def executemany(self, operation: str, parameters: _tp.Iterable[_tp.Union[_tp.Dict, _tp.Sequence]]):
|
108
|
+
pass
|
109
|
+
|
110
|
+
def fetchone(self) -> _tp.Tuple:
|
111
|
+
pass
|
112
|
+
|
113
|
+
def fetchmany(self, size: int = arraysize) -> _tp.Sequence[_tp.Tuple]:
|
114
|
+
pass
|
115
|
+
|
116
|
+
def close(self):
|
117
|
+
pass
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# Licensed to the Fintech Open Source Foundation (FINOS) under one or
|
2
|
+
# more contributor license agreements. See the NOTICE file distributed
|
3
|
+
# with this work for additional information regarding copyright ownership.
|
4
|
+
# FINOS licenses this file to you under the Apache License, Version 2.0
|
5
|
+
# (the "License"); you may not use this file except in compliance with the
|
6
|
+
# License. You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
|
16
|
+
import abc as _abc
|
17
|
+
import typing as _tp
|
18
|
+
|
19
|
+
from tracdap.rt.ext.storage import * # noqa
|
20
|
+
|
21
|
+
|
22
|
+
T_DATA = _tp.TypeVar("T_DATA")
|
23
|
+
T_SCHEMA = _tp.TypeVar("T_SCHEMA")
|
24
|
+
|
25
|
+
|
26
|
+
class IDataStorageBase(_tp.Generic[T_DATA, T_SCHEMA], _abc.ABC):
|
27
|
+
|
28
|
+
@_abc.abstractmethod
|
29
|
+
def data_type(self) -> _tp.Type[T_DATA]:
|
30
|
+
pass
|
31
|
+
|
32
|
+
@_abc.abstractmethod
|
33
|
+
def schema_type(self) -> _tp.Type[T_SCHEMA]:
|
34
|
+
pass
|
35
|
+
|
36
|
+
@_abc.abstractmethod
|
37
|
+
def has_table(self, table_name: str) -> bool:
|
38
|
+
pass
|
39
|
+
|
40
|
+
@_abc.abstractmethod
|
41
|
+
def list_tables(self) -> _tp.List[str]:
|
42
|
+
pass
|
43
|
+
|
44
|
+
@_abc.abstractmethod
|
45
|
+
def create_table(self, table_name: str, schema: T_SCHEMA):
|
46
|
+
pass
|
47
|
+
|
48
|
+
@_abc.abstractmethod
|
49
|
+
def read_table(self, table_name: str) -> T_DATA:
|
50
|
+
pass
|
51
|
+
|
52
|
+
@_abc.abstractmethod
|
53
|
+
def write_table(self, table_name: str, records: T_DATA):
|
54
|
+
pass
|
55
|
+
|
56
|
+
@_abc.abstractmethod
|
57
|
+
def native_read_query(self, query: str, **parameters) -> T_DATA:
|
58
|
+
pass
|
@@ -1,8 +1,9 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
1
|
+
# Licensed to the Fintech Open Source Foundation (FINOS) under one or
|
2
|
+
# more contributor license agreements. See the NOTICE file distributed
|
3
|
+
# with this work for additional information regarding copyright ownership.
|
4
|
+
# FINOS licenses this file to you under the Apache License, Version 2.0
|
5
|
+
# (the "License"); you may not use this file except in compliance with the
|
6
|
+
# License. You may obtain a copy of the License at
|
6
7
|
#
|
7
8
|
# http://www.apache.org/licenses/LICENSE-2.0
|
8
9
|
#
|
tracdap/rt/_impl/grpc/codec.py
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
1
|
+
# Licensed to the Fintech Open Source Foundation (FINOS) under one or
|
2
|
+
# more contributor license agreements. See the NOTICE file distributed
|
3
|
+
# with this work for additional information regarding copyright ownership.
|
4
|
+
# FINOS licenses this file to you under the Apache License, Version 2.0
|
5
|
+
# (the "License"); you may not use this file except in compliance with the
|
6
|
+
# License. You may obtain a copy of the License at
|
6
7
|
#
|
7
8
|
# http://www.apache.org/licenses/LICENSE-2.0
|
8
9
|
#
|
@@ -17,7 +17,7 @@ from tracdap.rt._impl.grpc.tracdap.metadata import object_id_pb2 as tracdap_dot_
|
|
17
17
|
from tracdap.rt._impl.grpc.tracdap.metadata import tag_update_pb2 as tracdap_dot_rt_dot___impl_dot_grpc_dot_tracdap_dot_metadata_dot_tag__update__pb2
|
18
18
|
|
19
19
|
|
20
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n0tracdap/rt/_impl/grpc/tracdap/metadata/job.proto\x12\x10tracdap.metadata\x1a\x31tracdap/rt/_impl/grpc/tracdap/metadata/type.proto\x1a\x36tracdap/rt/_impl/grpc/tracdap/metadata/object_id.proto\x1a\x37tracdap/rt/_impl/grpc/tracdap/metadata/tag_update.proto\"\
|
20
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n0tracdap/rt/_impl/grpc/tracdap/metadata/job.proto\x12\x10tracdap.metadata\x1a\x31tracdap/rt/_impl/grpc/tracdap/metadata/type.proto\x1a\x36tracdap/rt/_impl/grpc/tracdap/metadata/object_id.proto\x1a\x37tracdap/rt/_impl/grpc/tracdap/metadata/tag_update.proto\"\x84\x03\n\rJobDefinition\x12*\n\x07jobType\x18\x01 \x01(\x0e\x32\x19.tracdap.metadata.JobType\x12\x31\n\x08runModel\x18\x02 \x01(\x0b\x32\x1d.tracdap.metadata.RunModelJobH\x00\x12/\n\x07runFlow\x18\x03 \x01(\x0b\x32\x1c.tracdap.metadata.RunFlowJobH\x00\x12\x37\n\x0bimportModel\x18\x04 \x01(\x0b\x32 .tracdap.metadata.ImportModelJobH\x00\x12\x35\n\nimportData\x18\x05 \x01(\x0b\x32\x1f.tracdap.metadata.ImportDataJobH\x00\x12\x35\n\nexportData\x18\x06 \x01(\x0b\x32\x1f.tracdap.metadata.ExportDataJobH\x00\x12.\n\x08jobGroup\x18\x07 \x01(\x0b\x32\x1a.tracdap.metadata.JobGroupH\x00\x42\x0c\n\njobDetails\"\xac\x05\n\x0bRunModelJob\x12,\n\x05model\x18\x01 \x01(\x0b\x32\x1d.tracdap.metadata.TagSelector\x12\x41\n\nparameters\x18\x02 \x03(\x0b\x32-.tracdap.metadata.RunModelJob.ParametersEntry\x12\x39\n\x06inputs\x18\x03 \x03(\x0b\x32).tracdap.metadata.RunModelJob.InputsEntry\x12;\n\x07outputs\x18\x04 \x03(\x0b\x32*.tracdap.metadata.RunModelJob.OutputsEntry\x12\x45\n\x0cpriorOutputs\x18\x05 \x03(\x0b\x32/.tracdap.metadata.RunModelJob.PriorOutputsEntry\x12\x30\n\x0boutputAttrs\x18\x06 \x03(\x0b\x32\x1b.tracdap.metadata.TagUpdate\x1aJ\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.tracdap.metadata.Value:\x02\x38\x01\x1aL\n\x0bInputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.tracdap.metadata.TagSelector:\x02\x38\x01\x1aM\n\x0cOutputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.tracdap.metadata.TagSelector:\x02\x38\x01\x1aR\n\x11PriorOutputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.tracdap.metadata.TagSelector:\x02\x38\x01\"\xae\x06\n\nRunFlowJob\x12+\n\x04\x66low\x18\x01 \x01(\x0b\x32\x1d.tracdap.metadata.TagSelector\x12@\n\nparameters\x18\x02 \x03(\x0b\x32,.tracdap.metadata.RunFlowJob.ParametersEntry\x12\x38\n\x06inputs\x18\x03 \x03(\x0b\x32(.tracdap.metadata.RunFlowJob.InputsEntry\x12:\n\x07outputs\x18\x04 \x03(\x0b\x32).tracdap.metadata.RunFlowJob.OutputsEntry\x12\x44\n\x0cpriorOutputs\x18\x05 \x03(\x0b\x32..tracdap.metadata.RunFlowJob.PriorOutputsEntry\x12\x38\n\x06models\x18\x06 \x03(\x0b\x32(.tracdap.metadata.RunFlowJob.ModelsEntry\x12\x30\n\x0boutputAttrs\x18\x07 \x03(\x0b\x32\x1b.tracdap.metadata.TagUpdate\x1aJ\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.tracdap.metadata.Value:\x02\x38\x01\x1aL\n\x0bInputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.tracdap.metadata.TagSelector:\x02\x38\x01\x1aM\n\x0cOutputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.tracdap.metadata.TagSelector:\x02\x38\x01\x1aR\n\x11PriorOutputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.tracdap.metadata.TagSelector:\x02\x38\x01\x1aL\n\x0bModelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.tracdap.metadata.TagSelector:\x02\x38\x01\"\xd7\x01\n\x0eImportModelJob\x12\x10\n\x08language\x18\x01 \x01(\t\x12\x12\n\nrepository\x18\x02 \x01(\t\x12\x19\n\x0cpackageGroup\x18\x07 \x01(\tH\x00\x88\x01\x01\x12\x0f\n\x07package\x18\x08 \x01(\t\x12\x0f\n\x07version\x18\x05 \x01(\t\x12\x12\n\nentryPoint\x18\x04 \x01(\t\x12\x0c\n\x04path\x18\x03 \x01(\t\x12/\n\nmodelAttrs\x18\x06 \x03(\x0b\x32\x1b.tracdap.metadata.TagUpdateB\x0f\n\r_packageGroup\"\x8d\x07\n\rImportDataJob\x12,\n\x05model\x18\x01 \x01(\x0b\x32\x1d.tracdap.metadata.TagSelector\x12\x43\n\nparameters\x18\x02 \x03(\x0b\x32/.tracdap.metadata.ImportDataJob.ParametersEntry\x12;\n\x06inputs\x18\x03 \x03(\x0b\x32+.tracdap.metadata.ImportDataJob.InputsEntry\x12=\n\x07outputs\x18\x04 \x03(\x0b\x32,.tracdap.metadata.ImportDataJob.OutputsEntry\x12G\n\x0cpriorOutputs\x18\x05 \x03(\x0b\x32\x31.tracdap.metadata.ImportDataJob.PriorOutputsEntry\x12\x15\n\rstorageAccess\x18\x06 \x03(\t\x12=\n\x07imports\x18\x07 \x03(\x0b\x32,.tracdap.metadata.ImportDataJob.ImportsEntry\x12\x30\n\x0boutputAttrs\x18\x08 \x03(\x0b\x32\x1b.tracdap.metadata.TagUpdate\x12\x30\n\x0bimportAttrs\x18\t \x03(\x0b\x32\x1b.tracdap.metadata.TagUpdate\x1aJ\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.tracdap.metadata.Value:\x02\x38\x01\x1aL\n\x0bInputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.tracdap.metadata.TagSelector:\x02\x38\x01\x1aM\n\x0cOutputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.tracdap.metadata.TagSelector:\x02\x38\x01\x1aR\n\x11PriorOutputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.tracdap.metadata.TagSelector:\x02\x38\x01\x1aM\n\x0cImportsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.tracdap.metadata.TagSelector:\x02\x38\x01\"\xdb\x06\n\rExportDataJob\x12,\n\x05model\x18\x01 \x01(\x0b\x32\x1d.tracdap.metadata.TagSelector\x12\x43\n\nparameters\x18\x02 \x03(\x0b\x32/.tracdap.metadata.ExportDataJob.ParametersEntry\x12;\n\x06inputs\x18\x03 \x03(\x0b\x32+.tracdap.metadata.ExportDataJob.InputsEntry\x12=\n\x07outputs\x18\x04 \x03(\x0b\x32,.tracdap.metadata.ExportDataJob.OutputsEntry\x12G\n\x0cpriorOutputs\x18\x05 \x03(\x0b\x32\x31.tracdap.metadata.ExportDataJob.PriorOutputsEntry\x12\x15\n\rstorageAccess\x18\x06 \x03(\t\x12=\n\x07\x65xports\x18\x07 \x03(\x0b\x32,.tracdap.metadata.ExportDataJob.ExportsEntry\x12\x30\n\x0boutputAttrs\x18\x08 \x03(\x0b\x32\x1b.tracdap.metadata.TagUpdate\x1aJ\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.tracdap.metadata.Value:\x02\x38\x01\x1aL\n\x0bInputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.tracdap.metadata.TagSelector:\x02\x38\x01\x1aM\n\x0cOutputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.tracdap.metadata.TagSelector:\x02\x38\x01\x1aR\n\x11PriorOutputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.tracdap.metadata.TagSelector:\x02\x38\x01\x1aM\n\x0c\x45xportsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.tracdap.metadata.TagSelector:\x02\x38\x01\"\xc7\x01\n\x08JobGroup\x12\x34\n\x0cjobGroupType\x18\x01 \x01(\x0e\x32\x1e.tracdap.metadata.JobGroupType\x12:\n\nsequential\x18\x02 \x01(\x0b\x32$.tracdap.metadata.SequentialJobGroupH\x00\x12\x36\n\x08parallel\x18\x03 \x01(\x0b\x32\".tracdap.metadata.ParallelJobGroupH\x00\x42\x11\n\x0fjobGroupDetails\"C\n\x12SequentialJobGroup\x12-\n\x04jobs\x18\x01 \x03(\x0b\x32\x1f.tracdap.metadata.JobDefinition\"A\n\x10ParallelJobGroup\x12-\n\x04jobs\x18\x01 \x03(\x0b\x32\x1f.tracdap.metadata.JobDefinition*\x7f\n\x07JobType\x12\x14\n\x10JOB_TYPE_NOT_SET\x10\x00\x12\r\n\tRUN_MODEL\x10\x01\x12\x0c\n\x08RUN_FLOW\x10\x02\x12\x10\n\x0cIMPORT_MODEL\x10\x03\x12\x0f\n\x0bIMPORT_DATA\x10\x04\x12\x0f\n\x0b\x45XPORT_DATA\x10\x05\x12\r\n\tJOB_GROUP\x10\x06*\xb8\x01\n\rJobStatusCode\x12\x1b\n\x17JOB_STATUS_CODE_NOT_SET\x10\x00\x12\r\n\tPREPARING\x10\x01\x12\r\n\tVALIDATED\x10\x02\x12\x0b\n\x07PENDING\x10\x03\x12\n\n\x06QUEUED\x10\x04\x12\r\n\tSUBMITTED\x10\x05\x12\x0b\n\x07RUNNING\x10\x06\x12\r\n\tFINISHING\x10\x07\x12\r\n\tSUCCEEDED\x10\x08\x12\n\n\x06\x46\x41ILED\x10\t\x12\r\n\tCANCELLED\x10\n*\\\n\x0cJobGroupType\x12\x1a\n\x16JOB_GROUP_TYPE_NOT_SET\x10\x00\x12\x18\n\x14SEQUENTIAL_JOB_GROUP\x10\x01\x12\x16\n\x12PARALLEL_JOB_GROUP\x10\x02\x42\x1e\n\x1aorg.finos.tracdap.metadataP\x01\x62\x06proto3')
|
21
21
|
|
22
22
|
_globals = globals()
|
23
23
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
@@ -63,58 +63,66 @@ if _descriptor._USE_C_DESCRIPTORS == False:
|
|
63
63
|
_globals['_EXPORTDATAJOB_PRIOROUTPUTSENTRY']._serialized_options = b'8\001'
|
64
64
|
_globals['_EXPORTDATAJOB_EXPORTSENTRY']._options = None
|
65
65
|
_globals['_EXPORTDATAJOB_EXPORTSENTRY']._serialized_options = b'8\001'
|
66
|
-
_globals['_JOBTYPE']._serialized_start=
|
67
|
-
_globals['_JOBTYPE']._serialized_end=
|
68
|
-
_globals['_JOBSTATUSCODE']._serialized_start=
|
69
|
-
_globals['_JOBSTATUSCODE']._serialized_end=
|
66
|
+
_globals['_JOBTYPE']._serialized_start=4459
|
67
|
+
_globals['_JOBTYPE']._serialized_end=4586
|
68
|
+
_globals['_JOBSTATUSCODE']._serialized_start=4589
|
69
|
+
_globals['_JOBSTATUSCODE']._serialized_end=4773
|
70
|
+
_globals['_JOBGROUPTYPE']._serialized_start=4775
|
71
|
+
_globals['_JOBGROUPTYPE']._serialized_end=4867
|
70
72
|
_globals['_JOBDEFINITION']._serialized_start=235
|
71
|
-
_globals['_JOBDEFINITION']._serialized_end=
|
72
|
-
_globals['_RUNMODELJOB']._serialized_start=
|
73
|
-
_globals['_RUNMODELJOB']._serialized_end=
|
74
|
-
_globals['_RUNMODELJOB_PARAMETERSENTRY']._serialized_start=
|
75
|
-
_globals['_RUNMODELJOB_PARAMETERSENTRY']._serialized_end=
|
76
|
-
_globals['_RUNMODELJOB_INPUTSENTRY']._serialized_start=
|
77
|
-
_globals['_RUNMODELJOB_INPUTSENTRY']._serialized_end=
|
78
|
-
_globals['_RUNMODELJOB_OUTPUTSENTRY']._serialized_start=
|
79
|
-
_globals['_RUNMODELJOB_OUTPUTSENTRY']._serialized_end=
|
80
|
-
_globals['_RUNMODELJOB_PRIOROUTPUTSENTRY']._serialized_start=
|
81
|
-
_globals['_RUNMODELJOB_PRIOROUTPUTSENTRY']._serialized_end=
|
82
|
-
_globals['_RUNFLOWJOB']._serialized_start=
|
83
|
-
_globals['_RUNFLOWJOB']._serialized_end=
|
84
|
-
_globals['_RUNFLOWJOB_PARAMETERSENTRY']._serialized_start=
|
85
|
-
_globals['_RUNFLOWJOB_PARAMETERSENTRY']._serialized_end=
|
86
|
-
_globals['_RUNFLOWJOB_INPUTSENTRY']._serialized_start=
|
87
|
-
_globals['_RUNFLOWJOB_INPUTSENTRY']._serialized_end=
|
88
|
-
_globals['_RUNFLOWJOB_OUTPUTSENTRY']._serialized_start=
|
89
|
-
_globals['_RUNFLOWJOB_OUTPUTSENTRY']._serialized_end=
|
90
|
-
_globals['_RUNFLOWJOB_PRIOROUTPUTSENTRY']._serialized_start=
|
91
|
-
_globals['_RUNFLOWJOB_PRIOROUTPUTSENTRY']._serialized_end=
|
92
|
-
_globals['_RUNFLOWJOB_MODELSENTRY']._serialized_start=
|
93
|
-
_globals['_RUNFLOWJOB_MODELSENTRY']._serialized_end=
|
94
|
-
_globals['_IMPORTMODELJOB']._serialized_start=
|
95
|
-
_globals['_IMPORTMODELJOB']._serialized_end=
|
96
|
-
_globals['_IMPORTDATAJOB']._serialized_start=
|
97
|
-
_globals['_IMPORTDATAJOB']._serialized_end=
|
98
|
-
_globals['_IMPORTDATAJOB_PARAMETERSENTRY']._serialized_start=
|
99
|
-
_globals['_IMPORTDATAJOB_PARAMETERSENTRY']._serialized_end=
|
100
|
-
_globals['_IMPORTDATAJOB_INPUTSENTRY']._serialized_start=
|
101
|
-
_globals['_IMPORTDATAJOB_INPUTSENTRY']._serialized_end=
|
102
|
-
_globals['_IMPORTDATAJOB_OUTPUTSENTRY']._serialized_start=
|
103
|
-
_globals['_IMPORTDATAJOB_OUTPUTSENTRY']._serialized_end=
|
104
|
-
_globals['_IMPORTDATAJOB_PRIOROUTPUTSENTRY']._serialized_start=
|
105
|
-
_globals['_IMPORTDATAJOB_PRIOROUTPUTSENTRY']._serialized_end=
|
106
|
-
_globals['_IMPORTDATAJOB_IMPORTSENTRY']._serialized_start=
|
107
|
-
_globals['_IMPORTDATAJOB_IMPORTSENTRY']._serialized_end=
|
108
|
-
_globals['_EXPORTDATAJOB']._serialized_start=
|
109
|
-
_globals['_EXPORTDATAJOB']._serialized_end=
|
110
|
-
_globals['_EXPORTDATAJOB_PARAMETERSENTRY']._serialized_start=
|
111
|
-
_globals['_EXPORTDATAJOB_PARAMETERSENTRY']._serialized_end=
|
112
|
-
_globals['_EXPORTDATAJOB_INPUTSENTRY']._serialized_start=
|
113
|
-
_globals['_EXPORTDATAJOB_INPUTSENTRY']._serialized_end=
|
114
|
-
_globals['_EXPORTDATAJOB_OUTPUTSENTRY']._serialized_start=
|
115
|
-
_globals['_EXPORTDATAJOB_OUTPUTSENTRY']._serialized_end=
|
116
|
-
_globals['_EXPORTDATAJOB_PRIOROUTPUTSENTRY']._serialized_start=
|
117
|
-
_globals['_EXPORTDATAJOB_PRIOROUTPUTSENTRY']._serialized_end=
|
118
|
-
_globals['_EXPORTDATAJOB_EXPORTSENTRY']._serialized_start=
|
119
|
-
_globals['_EXPORTDATAJOB_EXPORTSENTRY']._serialized_end=
|
73
|
+
_globals['_JOBDEFINITION']._serialized_end=623
|
74
|
+
_globals['_RUNMODELJOB']._serialized_start=626
|
75
|
+
_globals['_RUNMODELJOB']._serialized_end=1310
|
76
|
+
_globals['_RUNMODELJOB_PARAMETERSENTRY']._serialized_start=995
|
77
|
+
_globals['_RUNMODELJOB_PARAMETERSENTRY']._serialized_end=1069
|
78
|
+
_globals['_RUNMODELJOB_INPUTSENTRY']._serialized_start=1071
|
79
|
+
_globals['_RUNMODELJOB_INPUTSENTRY']._serialized_end=1147
|
80
|
+
_globals['_RUNMODELJOB_OUTPUTSENTRY']._serialized_start=1149
|
81
|
+
_globals['_RUNMODELJOB_OUTPUTSENTRY']._serialized_end=1226
|
82
|
+
_globals['_RUNMODELJOB_PRIOROUTPUTSENTRY']._serialized_start=1228
|
83
|
+
_globals['_RUNMODELJOB_PRIOROUTPUTSENTRY']._serialized_end=1310
|
84
|
+
_globals['_RUNFLOWJOB']._serialized_start=1313
|
85
|
+
_globals['_RUNFLOWJOB']._serialized_end=2127
|
86
|
+
_globals['_RUNFLOWJOB_PARAMETERSENTRY']._serialized_start=995
|
87
|
+
_globals['_RUNFLOWJOB_PARAMETERSENTRY']._serialized_end=1069
|
88
|
+
_globals['_RUNFLOWJOB_INPUTSENTRY']._serialized_start=1071
|
89
|
+
_globals['_RUNFLOWJOB_INPUTSENTRY']._serialized_end=1147
|
90
|
+
_globals['_RUNFLOWJOB_OUTPUTSENTRY']._serialized_start=1149
|
91
|
+
_globals['_RUNFLOWJOB_OUTPUTSENTRY']._serialized_end=1226
|
92
|
+
_globals['_RUNFLOWJOB_PRIOROUTPUTSENTRY']._serialized_start=1228
|
93
|
+
_globals['_RUNFLOWJOB_PRIOROUTPUTSENTRY']._serialized_end=1310
|
94
|
+
_globals['_RUNFLOWJOB_MODELSENTRY']._serialized_start=2051
|
95
|
+
_globals['_RUNFLOWJOB_MODELSENTRY']._serialized_end=2127
|
96
|
+
_globals['_IMPORTMODELJOB']._serialized_start=2130
|
97
|
+
_globals['_IMPORTMODELJOB']._serialized_end=2345
|
98
|
+
_globals['_IMPORTDATAJOB']._serialized_start=2348
|
99
|
+
_globals['_IMPORTDATAJOB']._serialized_end=3257
|
100
|
+
_globals['_IMPORTDATAJOB_PARAMETERSENTRY']._serialized_start=995
|
101
|
+
_globals['_IMPORTDATAJOB_PARAMETERSENTRY']._serialized_end=1069
|
102
|
+
_globals['_IMPORTDATAJOB_INPUTSENTRY']._serialized_start=1071
|
103
|
+
_globals['_IMPORTDATAJOB_INPUTSENTRY']._serialized_end=1147
|
104
|
+
_globals['_IMPORTDATAJOB_OUTPUTSENTRY']._serialized_start=1149
|
105
|
+
_globals['_IMPORTDATAJOB_OUTPUTSENTRY']._serialized_end=1226
|
106
|
+
_globals['_IMPORTDATAJOB_PRIOROUTPUTSENTRY']._serialized_start=1228
|
107
|
+
_globals['_IMPORTDATAJOB_PRIOROUTPUTSENTRY']._serialized_end=1310
|
108
|
+
_globals['_IMPORTDATAJOB_IMPORTSENTRY']._serialized_start=3180
|
109
|
+
_globals['_IMPORTDATAJOB_IMPORTSENTRY']._serialized_end=3257
|
110
|
+
_globals['_EXPORTDATAJOB']._serialized_start=3260
|
111
|
+
_globals['_EXPORTDATAJOB']._serialized_end=4119
|
112
|
+
_globals['_EXPORTDATAJOB_PARAMETERSENTRY']._serialized_start=995
|
113
|
+
_globals['_EXPORTDATAJOB_PARAMETERSENTRY']._serialized_end=1069
|
114
|
+
_globals['_EXPORTDATAJOB_INPUTSENTRY']._serialized_start=1071
|
115
|
+
_globals['_EXPORTDATAJOB_INPUTSENTRY']._serialized_end=1147
|
116
|
+
_globals['_EXPORTDATAJOB_OUTPUTSENTRY']._serialized_start=1149
|
117
|
+
_globals['_EXPORTDATAJOB_OUTPUTSENTRY']._serialized_end=1226
|
118
|
+
_globals['_EXPORTDATAJOB_PRIOROUTPUTSENTRY']._serialized_start=1228
|
119
|
+
_globals['_EXPORTDATAJOB_PRIOROUTPUTSENTRY']._serialized_end=1310
|
120
|
+
_globals['_EXPORTDATAJOB_EXPORTSENTRY']._serialized_start=4042
|
121
|
+
_globals['_EXPORTDATAJOB_EXPORTSENTRY']._serialized_end=4119
|
122
|
+
_globals['_JOBGROUP']._serialized_start=4122
|
123
|
+
_globals['_JOBGROUP']._serialized_end=4321
|
124
|
+
_globals['_SEQUENTIALJOBGROUP']._serialized_start=4323
|
125
|
+
_globals['_SEQUENTIALJOBGROUP']._serialized_end=4390
|
126
|
+
_globals['_PARALLELJOBGROUP']._serialized_start=4392
|
127
|
+
_globals['_PARALLELJOBGROUP']._serialized_end=4457
|
120
128
|
# @@protoc_insertion_point(module_scope)
|
@@ -17,6 +17,7 @@ class JobType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
17
17
|
IMPORT_MODEL: _ClassVar[JobType]
|
18
18
|
IMPORT_DATA: _ClassVar[JobType]
|
19
19
|
EXPORT_DATA: _ClassVar[JobType]
|
20
|
+
JOB_GROUP: _ClassVar[JobType]
|
20
21
|
|
21
22
|
class JobStatusCode(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
22
23
|
__slots__ = ()
|
@@ -31,12 +32,19 @@ class JobStatusCode(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
31
32
|
SUCCEEDED: _ClassVar[JobStatusCode]
|
32
33
|
FAILED: _ClassVar[JobStatusCode]
|
33
34
|
CANCELLED: _ClassVar[JobStatusCode]
|
35
|
+
|
36
|
+
class JobGroupType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
37
|
+
__slots__ = ()
|
38
|
+
JOB_GROUP_TYPE_NOT_SET: _ClassVar[JobGroupType]
|
39
|
+
SEQUENTIAL_JOB_GROUP: _ClassVar[JobGroupType]
|
40
|
+
PARALLEL_JOB_GROUP: _ClassVar[JobGroupType]
|
34
41
|
JOB_TYPE_NOT_SET: JobType
|
35
42
|
RUN_MODEL: JobType
|
36
43
|
RUN_FLOW: JobType
|
37
44
|
IMPORT_MODEL: JobType
|
38
45
|
IMPORT_DATA: JobType
|
39
46
|
EXPORT_DATA: JobType
|
47
|
+
JOB_GROUP: JobType
|
40
48
|
JOB_STATUS_CODE_NOT_SET: JobStatusCode
|
41
49
|
PREPARING: JobStatusCode
|
42
50
|
VALIDATED: JobStatusCode
|
@@ -48,22 +56,27 @@ FINISHING: JobStatusCode
|
|
48
56
|
SUCCEEDED: JobStatusCode
|
49
57
|
FAILED: JobStatusCode
|
50
58
|
CANCELLED: JobStatusCode
|
59
|
+
JOB_GROUP_TYPE_NOT_SET: JobGroupType
|
60
|
+
SEQUENTIAL_JOB_GROUP: JobGroupType
|
61
|
+
PARALLEL_JOB_GROUP: JobGroupType
|
51
62
|
|
52
63
|
class JobDefinition(_message.Message):
|
53
|
-
__slots__ = ("jobType", "runModel", "runFlow", "importModel", "importData", "exportData")
|
64
|
+
__slots__ = ("jobType", "runModel", "runFlow", "importModel", "importData", "exportData", "jobGroup")
|
54
65
|
JOBTYPE_FIELD_NUMBER: _ClassVar[int]
|
55
66
|
RUNMODEL_FIELD_NUMBER: _ClassVar[int]
|
56
67
|
RUNFLOW_FIELD_NUMBER: _ClassVar[int]
|
57
68
|
IMPORTMODEL_FIELD_NUMBER: _ClassVar[int]
|
58
69
|
IMPORTDATA_FIELD_NUMBER: _ClassVar[int]
|
59
70
|
EXPORTDATA_FIELD_NUMBER: _ClassVar[int]
|
71
|
+
JOBGROUP_FIELD_NUMBER: _ClassVar[int]
|
60
72
|
jobType: JobType
|
61
73
|
runModel: RunModelJob
|
62
74
|
runFlow: RunFlowJob
|
63
75
|
importModel: ImportModelJob
|
64
76
|
importData: ImportDataJob
|
65
77
|
exportData: ExportDataJob
|
66
|
-
|
78
|
+
jobGroup: JobGroup
|
79
|
+
def __init__(self, jobType: _Optional[_Union[JobType, str]] = ..., runModel: _Optional[_Union[RunModelJob, _Mapping]] = ..., runFlow: _Optional[_Union[RunFlowJob, _Mapping]] = ..., importModel: _Optional[_Union[ImportModelJob, _Mapping]] = ..., importData: _Optional[_Union[ImportDataJob, _Mapping]] = ..., exportData: _Optional[_Union[ExportDataJob, _Mapping]] = ..., jobGroup: _Optional[_Union[JobGroup, _Mapping]] = ...) -> None: ...
|
67
80
|
|
68
81
|
class RunModelJob(_message.Message):
|
69
82
|
__slots__ = ("model", "parameters", "inputs", "outputs", "priorOutputs", "outputAttrs")
|
@@ -293,3 +306,25 @@ class ExportDataJob(_message.Message):
|
|
293
306
|
exports: _containers.MessageMap[str, _object_id_pb2.TagSelector]
|
294
307
|
outputAttrs: _containers.RepeatedCompositeFieldContainer[_tag_update_pb2.TagUpdate]
|
295
308
|
def __init__(self, model: _Optional[_Union[_object_id_pb2.TagSelector, _Mapping]] = ..., parameters: _Optional[_Mapping[str, _type_pb2.Value]] = ..., inputs: _Optional[_Mapping[str, _object_id_pb2.TagSelector]] = ..., outputs: _Optional[_Mapping[str, _object_id_pb2.TagSelector]] = ..., priorOutputs: _Optional[_Mapping[str, _object_id_pb2.TagSelector]] = ..., storageAccess: _Optional[_Iterable[str]] = ..., exports: _Optional[_Mapping[str, _object_id_pb2.TagSelector]] = ..., outputAttrs: _Optional[_Iterable[_Union[_tag_update_pb2.TagUpdate, _Mapping]]] = ...) -> None: ...
|
309
|
+
|
310
|
+
class JobGroup(_message.Message):
|
311
|
+
__slots__ = ("jobGroupType", "sequential", "parallel")
|
312
|
+
JOBGROUPTYPE_FIELD_NUMBER: _ClassVar[int]
|
313
|
+
SEQUENTIAL_FIELD_NUMBER: _ClassVar[int]
|
314
|
+
PARALLEL_FIELD_NUMBER: _ClassVar[int]
|
315
|
+
jobGroupType: JobGroupType
|
316
|
+
sequential: SequentialJobGroup
|
317
|
+
parallel: ParallelJobGroup
|
318
|
+
def __init__(self, jobGroupType: _Optional[_Union[JobGroupType, str]] = ..., sequential: _Optional[_Union[SequentialJobGroup, _Mapping]] = ..., parallel: _Optional[_Union[ParallelJobGroup, _Mapping]] = ...) -> None: ...
|
319
|
+
|
320
|
+
class SequentialJobGroup(_message.Message):
|
321
|
+
__slots__ = ("jobs",)
|
322
|
+
JOBS_FIELD_NUMBER: _ClassVar[int]
|
323
|
+
jobs: _containers.RepeatedCompositeFieldContainer[JobDefinition]
|
324
|
+
def __init__(self, jobs: _Optional[_Iterable[_Union[JobDefinition, _Mapping]]] = ...) -> None: ...
|
325
|
+
|
326
|
+
class ParallelJobGroup(_message.Message):
|
327
|
+
__slots__ = ("jobs",)
|
328
|
+
JOBS_FIELD_NUMBER: _ClassVar[int]
|
329
|
+
jobs: _containers.RepeatedCompositeFieldContainer[JobDefinition]
|
330
|
+
def __init__(self, jobs: _Optional[_Iterable[_Union[JobDefinition, _Mapping]]] = ...) -> None: ...
|
tracdap/rt/_impl/guard_rails.py
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
1
|
+
# Licensed to the Fintech Open Source Foundation (FINOS) under one or
|
2
|
+
# more contributor license agreements. See the NOTICE file distributed
|
3
|
+
# with this work for additional information regarding copyright ownership.
|
4
|
+
# FINOS licenses this file to you under the Apache License, Version 2.0
|
5
|
+
# (the "License"); you may not use this file except in compliance with the
|
6
|
+
# License. You may obtain a copy of the License at
|
6
7
|
#
|
7
8
|
# http://www.apache.org/licenses/LICENSE-2.0
|
8
9
|
#
|
tracdap/rt/_impl/models.py
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
1
|
+
# Licensed to the Fintech Open Source Foundation (FINOS) under one or
|
2
|
+
# more contributor license agreements. See the NOTICE file distributed
|
3
|
+
# with this work for additional information regarding copyright ownership.
|
4
|
+
# FINOS licenses this file to you under the Apache License, Version 2.0
|
5
|
+
# (the "License"); you may not use this file except in compliance with the
|
6
|
+
# License. You may obtain a copy of the License at
|
6
7
|
#
|
7
8
|
# http://www.apache.org/licenses/LICENSE-2.0
|
8
9
|
#
|
tracdap/rt/_impl/repos.py
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
1
|
+
# Licensed to the Fintech Open Source Foundation (FINOS) under one or
|
2
|
+
# more contributor license agreements. See the NOTICE file distributed
|
3
|
+
# with this work for additional information regarding copyright ownership.
|
4
|
+
# FINOS licenses this file to you under the Apache License, Version 2.0
|
5
|
+
# (the "License"); you may not use this file except in compliance with the
|
6
|
+
# License. You may obtain a copy of the License at
|
6
7
|
#
|
7
8
|
# http://www.apache.org/licenses/LICENSE-2.0
|
8
9
|
#
|
tracdap/rt/_impl/schemas.py
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
1
|
+
# Licensed to the Fintech Open Source Foundation (FINOS) under one or
|
2
|
+
# more contributor license agreements. See the NOTICE file distributed
|
3
|
+
# with this work for additional information regarding copyright ownership.
|
4
|
+
# FINOS licenses this file to you under the Apache License, Version 2.0
|
5
|
+
# (the "License"); you may not use this file except in compliance with the
|
6
|
+
# License. You may obtain a copy of the License at
|
6
7
|
#
|
7
8
|
# http://www.apache.org/licenses/LICENSE-2.0
|
8
9
|
#
|
tracdap/rt/_impl/shim.py
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
1
|
+
# Licensed to the Fintech Open Source Foundation (FINOS) under one or
|
2
|
+
# more contributor license agreements. See the NOTICE file distributed
|
3
|
+
# with this work for additional information regarding copyright ownership.
|
4
|
+
# FINOS licenses this file to you under the Apache License, Version 2.0
|
5
|
+
# (the "License"); you may not use this file except in compliance with the
|
6
|
+
# License. You may obtain a copy of the License at
|
6
7
|
#
|
7
8
|
# http://www.apache.org/licenses/LICENSE-2.0
|
8
9
|
#
|
tracdap/rt/_impl/static_api.py
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
1
|
+
# Licensed to the Fintech Open Source Foundation (FINOS) under one or
|
2
|
+
# more contributor license agreements. See the NOTICE file distributed
|
3
|
+
# with this work for additional information regarding copyright ownership.
|
4
|
+
# FINOS licenses this file to you under the Apache License, Version 2.0
|
5
|
+
# (the "License"); you may not use this file except in compliance with the
|
6
|
+
# License. You may obtain a copy of the License at
|
6
7
|
#
|
7
8
|
# http://www.apache.org/licenses/LICENSE-2.0
|
8
9
|
#
|
@@ -15,6 +16,7 @@
|
|
15
16
|
import typing as _tp
|
16
17
|
import types as _ts
|
17
18
|
|
19
|
+
import tracdap.rt.api.experimental as _api
|
18
20
|
import tracdap.rt.metadata as _meta
|
19
21
|
import tracdap.rt.exceptions as _ex
|
20
22
|
import tracdap.rt._impl.data as _data
|
@@ -37,6 +39,24 @@ class StaticApiImpl(_StaticApiHook):
|
|
37
39
|
if not _StaticApiHook._is_registered():
|
38
40
|
_StaticApiHook._register(StaticApiImpl())
|
39
41
|
|
42
|
+
def array_type(self, item_type: _meta.BasicType) -> _meta.TypeDescriptor:
|
43
|
+
|
44
|
+
_val.validate_signature(self.array_type, item_type)
|
45
|
+
|
46
|
+
if not _val.is_primitive_type(item_type):
|
47
|
+
raise _ex.EModelValidation(f"Arrays can only contain primitive types, [{item_type}] is not primitive")
|
48
|
+
|
49
|
+
return _meta.TypeDescriptor(_meta.BasicType.ARRAY, arrayType=_meta.TypeDescriptor(item_type))
|
50
|
+
|
51
|
+
def map_type(self, entry_type: _meta.BasicType) -> _meta.TypeDescriptor:
|
52
|
+
|
53
|
+
_val.validate_signature(self.map_type, entry_type)
|
54
|
+
|
55
|
+
if not _val.is_primitive_type(entry_type):
|
56
|
+
raise _ex.EModelValidation(f"Maps can only contain primitive types, [{entry_type}] is not primitive")
|
57
|
+
|
58
|
+
return _meta.TypeDescriptor(_meta.BasicType.MAP, arrayType=_meta.TypeDescriptor(entry_type))
|
59
|
+
|
40
60
|
def define_attribute(
|
41
61
|
self, attr_name: str, attr_value: _tp.Any,
|
42
62
|
attr_type: _tp.Optional[_meta.BasicType] = None,
|
@@ -153,20 +173,14 @@ class StaticApiImpl(_StaticApiHook):
|
|
153
173
|
|
154
174
|
return _schemas.SchemaLoader.load_schema(package, schema_file)
|
155
175
|
|
156
|
-
def infer_schema(self, dataset:
|
176
|
+
def infer_schema(self, dataset: _api.DATA_API) -> _meta.SchemaDefinition:
|
157
177
|
|
158
|
-
|
159
|
-
arrow_schema = _data.DataMapping.pandas_to_arrow_schema(dataset)
|
178
|
+
_val.validate_signature(self.infer_schema, dataset)
|
160
179
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
else:
|
165
|
-
dataset_type = f"{type(dataset).__module__}.{type(dataset).__name__}"
|
166
|
-
message = f"Schema inference is not available for dataset type [{dataset_type}]"
|
167
|
-
raise _ex.ERuntimeValidation(message)
|
180
|
+
framework = _data.DataConverter.get_framework(dataset)
|
181
|
+
converter = _data.DataConverter.for_framework(framework)
|
168
182
|
|
169
|
-
return
|
183
|
+
return converter.infer_schema(dataset)
|
170
184
|
|
171
185
|
def define_input_table(
|
172
186
|
self, *fields: _tp.Union[_meta.FieldSchema, _tp.List[_meta.FieldSchema]],
|
tracdap/rt/_impl/storage.py
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
1
|
+
# Licensed to the Fintech Open Source Foundation (FINOS) under one or
|
2
|
+
# more contributor license agreements. See the NOTICE file distributed
|
3
|
+
# with this work for additional information regarding copyright ownership.
|
4
|
+
# FINOS licenses this file to you under the Apache License, Version 2.0
|
5
|
+
# (the "License"); you may not use this file except in compliance with the
|
6
|
+
# License. You may obtain a copy of the License at
|
6
7
|
#
|
7
8
|
# http://www.apache.org/licenses/LICENSE-2.0
|
8
9
|
#
|
@@ -32,8 +33,8 @@ import tracdap.rt._impl.data as _data
|
|
32
33
|
import tracdap.rt._impl.util as _util
|
33
34
|
import tracdap.rt._impl.validation as _val
|
34
35
|
|
35
|
-
# Import storage interfaces
|
36
|
-
from tracdap.rt.ext.storage import *
|
36
|
+
# Import storage interfaces (using the internal version, it has extra bits that are not public)
|
37
|
+
from tracdap.rt._impl.ext.storage import *
|
37
38
|
|
38
39
|
|
39
40
|
class FormatManager:
|