continuo-python-runtime 0.13.0__py3-none-any.whl → 0.14.0__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.
- continuo_python_runtime/cli.py +78 -6
- continuo_python_runtime/contract/loader.py +42 -11
- continuo_python_runtime/contract/ontology_check.py +89 -0
- {continuo_python_runtime-0.13.0.dist-info → continuo_python_runtime-0.14.0.dist-info}/METADATA +89 -6
- {continuo_python_runtime-0.13.0.dist-info → continuo_python_runtime-0.14.0.dist-info}/RECORD +9 -8
- {continuo_python_runtime-0.13.0.dist-info → continuo_python_runtime-0.14.0.dist-info}/WHEEL +0 -0
- {continuo_python_runtime-0.13.0.dist-info → continuo_python_runtime-0.14.0.dist-info}/entry_points.txt +0 -0
- {continuo_python_runtime-0.13.0.dist-info → continuo_python_runtime-0.14.0.dist-info}/licenses/LICENSE +0 -0
- {continuo_python_runtime-0.13.0.dist-info → continuo_python_runtime-0.14.0.dist-info}/licenses/NOTICE +0 -0
continuo_python_runtime/cli.py
CHANGED
|
@@ -8,7 +8,8 @@ import sys
|
|
|
8
8
|
from importlib import metadata
|
|
9
9
|
from pathlib import Path
|
|
10
10
|
|
|
11
|
-
from continuo_python_runtime.contract.loader import load_contract_dir
|
|
11
|
+
from continuo_python_runtime.contract.loader import load_contract_dir, load_contract_docs
|
|
12
|
+
from continuo_python_runtime.contract.ontology_check import check_service
|
|
12
13
|
from continuo_python_runtime.contract.pack import (
|
|
13
14
|
PACKAGE_SOURCE_USAGE,
|
|
14
15
|
build_bundle,
|
|
@@ -57,6 +58,18 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
57
58
|
)
|
|
58
59
|
validate_parser.add_argument("contract_dir", help="Path to contract directory")
|
|
59
60
|
validate_parser.add_argument("--dialect", default=None, help=dialect_help)
|
|
61
|
+
validate_parser.add_argument(
|
|
62
|
+
"--service",
|
|
63
|
+
default=None,
|
|
64
|
+
help="The service the contracts belong to: a contract whose `service` property "
|
|
65
|
+
"names another service is refused",
|
|
66
|
+
)
|
|
67
|
+
validate_parser.add_argument(
|
|
68
|
+
"--ontology",
|
|
69
|
+
default=None,
|
|
70
|
+
help="The company's ontology file (needs --service): check every contract "
|
|
71
|
+
"against it, as a release does",
|
|
72
|
+
)
|
|
60
73
|
|
|
61
74
|
# pack subcommand
|
|
62
75
|
pack_parser = subparsers.add_parser(
|
|
@@ -120,12 +133,19 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
120
133
|
)
|
|
121
134
|
|
|
122
135
|
args = parser.parse_args(argv)
|
|
136
|
+
if args.command == "validate" and args.ontology is not None and args.service is None:
|
|
137
|
+
validate_parser.error("--ontology needs --service")
|
|
123
138
|
if args.command == "pack" and (args.image is None) == (args.image_packages is None):
|
|
124
139
|
pack_parser.error(PACKAGE_SOURCE_USAGE)
|
|
125
140
|
|
|
126
141
|
try:
|
|
127
142
|
if args.command == "validate":
|
|
128
|
-
return cmd_validate(
|
|
143
|
+
return cmd_validate(
|
|
144
|
+
args.contract_dir,
|
|
145
|
+
args.dialect,
|
|
146
|
+
service=args.service,
|
|
147
|
+
ontology=args.ontology,
|
|
148
|
+
)
|
|
129
149
|
elif args.command == "pack":
|
|
130
150
|
return cmd_pack(
|
|
131
151
|
args.contract_dir,
|
|
@@ -158,10 +178,62 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
158
178
|
return 0
|
|
159
179
|
|
|
160
180
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
181
|
+
_FINDING_LEVELS = {"error": logging.ERROR, "warning": logging.WARNING, "info": logging.INFO}
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
def cmd_validate(
|
|
185
|
+
contract_dir: str,
|
|
186
|
+
dialect: str | None = None,
|
|
187
|
+
*,
|
|
188
|
+
service: str | None = None,
|
|
189
|
+
ontology: str | None = None,
|
|
190
|
+
) -> int:
|
|
191
|
+
"""Validate contracts in a directory.
|
|
192
|
+
|
|
193
|
+
With no ``service``, every contract is checked as a contract of any service
|
|
194
|
+
and nothing is logged. With a ``service``, a contract whose ``service``
|
|
195
|
+
property names another one is refused too, as ``pack`` refuses it.
|
|
196
|
+
|
|
197
|
+
With an ``ontology`` file (which needs the ``service``), each contract is
|
|
198
|
+
then checked against it by the per-service rules of continuo-contracts.
|
|
199
|
+
Each finding is logged at its level, ERROR for an error, WARNING for a
|
|
200
|
+
warning and INFO for information, as ``<severity> [<rule>] <subject>:
|
|
201
|
+
<message>``, in the order the library returns them, followed by one INFO
|
|
202
|
+
line counting the three. Any error makes the exit code 1. An ontology file
|
|
203
|
+
that cannot be read, is not an ontology or is refused by the library's
|
|
204
|
+
``ontology`` rule is one ERROR line and exit 1, before any finding. Nothing
|
|
205
|
+
goes to stdout.
|
|
206
|
+
"""
|
|
207
|
+
if service is None:
|
|
208
|
+
load_contract_dir(Path(contract_dir), dialect=dialect)
|
|
209
|
+
return 0
|
|
210
|
+
loaded = load_contract_docs(Path(contract_dir), dialect=dialect, service=service)
|
|
211
|
+
if ontology is None:
|
|
212
|
+
return 0
|
|
213
|
+
|
|
214
|
+
findings = check_service(
|
|
215
|
+
[doc for _, doc in loaded], service=service, ontology_path=Path(ontology)
|
|
216
|
+
)
|
|
217
|
+
for finding in findings:
|
|
218
|
+
logger.log(
|
|
219
|
+
_FINDING_LEVELS[finding.severity],
|
|
220
|
+
"%s [%s] %s: %s",
|
|
221
|
+
finding.severity,
|
|
222
|
+
finding.rule,
|
|
223
|
+
finding.subject,
|
|
224
|
+
finding.message,
|
|
225
|
+
)
|
|
226
|
+
counts = {severity: 0 for severity in _FINDING_LEVELS}
|
|
227
|
+
for finding in findings:
|
|
228
|
+
counts[finding.severity] += 1
|
|
229
|
+
logger.info(
|
|
230
|
+
"%d error(s), %d warning(s), %d info: %s",
|
|
231
|
+
counts["error"],
|
|
232
|
+
counts["warning"],
|
|
233
|
+
counts["info"],
|
|
234
|
+
service,
|
|
235
|
+
)
|
|
236
|
+
return 1 if counts["error"] else 0
|
|
165
237
|
|
|
166
238
|
|
|
167
239
|
def cmd_pack(
|
|
@@ -129,15 +129,22 @@ def issue_lines(file: Path | str, issues: Iterable[object]) -> list[str]:
|
|
|
129
129
|
|
|
130
130
|
|
|
131
131
|
def node_from_contract(
|
|
132
|
-
doc: Mapping[str, Any],
|
|
132
|
+
doc: Mapping[str, Any],
|
|
133
|
+
file: Path,
|
|
134
|
+
*,
|
|
135
|
+
dialect: str | None,
|
|
136
|
+
check_reads: bool,
|
|
137
|
+
service: str | None = None,
|
|
133
138
|
) -> Node:
|
|
134
139
|
"""Check the ODCS contract ``doc``, read from ``file``, and build its :class:`Node`.
|
|
135
140
|
|
|
136
141
|
continuo-contracts checks the contract first
|
|
137
|
-
(``validate_python_contract``,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
142
|
+
(``validate_python_contract``, of which only the base name of ``file``
|
|
143
|
+
counts for the file-name rule). With a ``service`` it also refuses a
|
|
144
|
+
contract whose authored ``service`` property names another service; with
|
|
145
|
+
none, that property is not compared. When it finds issues they become one
|
|
146
|
+
:class:`ContractError` with one :func:`issue_lines` line per issue, and
|
|
147
|
+
nothing else runs.
|
|
141
148
|
|
|
142
149
|
The runtime's own rules follow, each naming ``file`` and the relation:
|
|
143
150
|
the kind's reads rule (:mod:`~continuo_python_runtime.contract.kinds`),
|
|
@@ -155,7 +162,7 @@ def node_from_contract(
|
|
|
155
162
|
``required``), ``extra_columns``, ``config``, ``secret_ref``,
|
|
156
163
|
``mode_type``, the key when the node upserts and the assets.
|
|
157
164
|
"""
|
|
158
|
-
issues = validate_python_contract(doc, path=str(file), service=
|
|
165
|
+
issues = validate_python_contract(doc, path=str(file), service=service)
|
|
159
166
|
if issues:
|
|
160
167
|
raise ContractError("\n".join(issue_lines(file, issues)))
|
|
161
168
|
python = node_from_odcs(doc)
|
|
@@ -225,6 +232,27 @@ def load_contract_dir(
|
|
|
225
232
|
) -> list[Node]:
|
|
226
233
|
"""Load and check every ``*.odcs.yaml`` contract in ``path``, in file-name order.
|
|
227
234
|
|
|
235
|
+
The nodes, as :func:`load_contract_docs` loads them with no service. Every
|
|
236
|
+
refusal and every rule are described there.
|
|
237
|
+
"""
|
|
238
|
+
return [node for node, _ in load_contract_docs(path, dialect=dialect, check_reads=check_reads)]
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
def load_contract_docs(
|
|
242
|
+
path: Path,
|
|
243
|
+
*,
|
|
244
|
+
dialect: str | None = None,
|
|
245
|
+
check_reads: bool = True,
|
|
246
|
+
service: str | None = None,
|
|
247
|
+
) -> list[tuple[Node, Mapping[str, Any]]]:
|
|
248
|
+
"""Load and check every ``*.odcs.yaml`` contract in ``path``, in file-name order.
|
|
249
|
+
|
|
250
|
+
Each node comes with the document it was built from, the one read from its
|
|
251
|
+
file and checked, so a caller that needs the documents does not read the
|
|
252
|
+
files again. ``service``, when given, is the service the contracts belong
|
|
253
|
+
to: continuo-contracts then refuses a contract whose authored ``service``
|
|
254
|
+
property names another one, as :func:`node_from_contract` says.
|
|
255
|
+
|
|
228
256
|
Any other file whose name ends in ``.yml`` or ``.yaml``, in any case
|
|
229
257
|
(``legacy.YML``, ``t.odcs.YAML``, ``t.odcs.yml``), is refused: one
|
|
230
258
|
:class:`ContractError` names every such file, one line each, with how to
|
|
@@ -256,7 +284,8 @@ def load_contract_dir(
|
|
|
256
284
|
instead of blaming a valid read.
|
|
257
285
|
|
|
258
286
|
Raises ``ContractError`` for an unknown ``dialect``, a file in another
|
|
259
|
-
format, a folder with no contract, a contract that is refused
|
|
287
|
+
format, a folder with no contract, a contract that is refused (one that
|
|
288
|
+
names another service than ``service``, when given, included), and two
|
|
260
289
|
files that declare the same ``<schema>.<table>``, compared in lower case.
|
|
261
290
|
"""
|
|
262
291
|
if dialect is not None:
|
|
@@ -282,11 +311,13 @@ def load_contract_dir(
|
|
|
282
311
|
if not files:
|
|
283
312
|
raise ContractError(f"no contract files found in {path}")
|
|
284
313
|
|
|
285
|
-
|
|
314
|
+
loaded: list[tuple[Node, Mapping[str, Any]]] = []
|
|
286
315
|
relation_files: dict[str, Path] = {}
|
|
287
316
|
for file in files:
|
|
288
317
|
doc = parse_contract(read_contract_text(file), file)
|
|
289
|
-
node = node_from_contract(
|
|
318
|
+
node = node_from_contract(
|
|
319
|
+
doc, file, dialect=dialect, check_reads=check_reads, service=service
|
|
320
|
+
)
|
|
290
321
|
# Relations are compared in lower case, as continuo compares them: a
|
|
291
322
|
# warehouse folds the case of an unquoted name, so two contracts whose
|
|
292
323
|
# tables differ only in case would build one table.
|
|
@@ -297,5 +328,5 @@ def load_contract_dir(
|
|
|
297
328
|
f"duplicate node {node.relation} (in {existing} and {file})"
|
|
298
329
|
)
|
|
299
330
|
relation_files[key] = file
|
|
300
|
-
|
|
301
|
-
return
|
|
331
|
+
loaded.append((node, doc))
|
|
332
|
+
return loaded
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"""Check a Python service's contracts against the company's ontology file.
|
|
2
|
+
|
|
3
|
+
``continuo-runtime validate --service <name> --ontology <file>`` runs the
|
|
4
|
+
per-service rules of continuo-contracts over the contracts of one service:
|
|
5
|
+
each contract is stored as a release stores it, filled with what the
|
|
6
|
+
ontology knows and checked, so a team sees in its own CI what a release says
|
|
7
|
+
about its bindings. The rules read contracts against an ontology file that the
|
|
8
|
+
library's own ``ontology`` rule accepts, so a file that rule refuses stops the
|
|
9
|
+
check before any contract is read, as it does in the library's dbt check. This
|
|
10
|
+
is the only module of the runtime that imports the library's ontology modules.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
from collections.abc import Mapping, Sequence
|
|
16
|
+
from pathlib import Path
|
|
17
|
+
from typing import Any
|
|
18
|
+
|
|
19
|
+
from continuo_contracts import ontology
|
|
20
|
+
from continuo_contracts.contract import normalise_python
|
|
21
|
+
from continuo_contracts.errors import ContractsError, OntologyError
|
|
22
|
+
from continuo_contracts.ontology_check import (
|
|
23
|
+
PER_SERVICE_RULES,
|
|
24
|
+
Finding,
|
|
25
|
+
check,
|
|
26
|
+
ontology_findings,
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
from continuo_python_runtime.errors import ContractError
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _read_ontology(ontology_path: Path) -> ontology.Ontology:
|
|
33
|
+
"""Return the ontology the file ``ontology_path`` holds.
|
|
34
|
+
|
|
35
|
+
Raises ``ContractError``, with the message ``<file>: <reason>``, for a file
|
|
36
|
+
that cannot be read (missing, a folder, no permission), one that is not
|
|
37
|
+
UTF-8 text and one the library does not accept as an ontology, whose
|
|
38
|
+
reason is the library's own message. The ``ontology`` rule, which can
|
|
39
|
+
refuse a file that loads, is run by :func:`check_service`.
|
|
40
|
+
"""
|
|
41
|
+
try:
|
|
42
|
+
text = ontology_path.read_bytes().decode("utf-8")
|
|
43
|
+
except OSError as exc:
|
|
44
|
+
raise ContractError(f"{ontology_path}: {exc.strerror or exc}") from None
|
|
45
|
+
except UnicodeDecodeError as exc:
|
|
46
|
+
raise ContractError(f"{ontology_path}: the file is not UTF-8 text ({exc})") from None
|
|
47
|
+
try:
|
|
48
|
+
return ontology.load(text)
|
|
49
|
+
except OntologyError as exc:
|
|
50
|
+
raise ContractError(f"{ontology_path}: {exc}") from None
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def check_service(
|
|
54
|
+
docs: Sequence[Mapping[str, Any]], *, service: str, ontology_path: Path
|
|
55
|
+
) -> list[Finding]:
|
|
56
|
+
"""Return the findings of the per-service rules over ``docs``, the contracts of ``service``.
|
|
57
|
+
|
|
58
|
+
``docs`` are contract documents that continuo-contracts already accepted as
|
|
59
|
+
a Python contract; none is changed. The ontology file is read first, and
|
|
60
|
+
the library's ``ontology`` rule runs over it alone. Each document then goes
|
|
61
|
+
through ``normalise_python`` as the contract of ``service`` that reads
|
|
62
|
+
nothing the ontology tracks, then through ``ontology.resolve``, and the
|
|
63
|
+
rules ``contract``, ``coverage``, ``quality`` and ``privacy`` run over all
|
|
64
|
+
of them. The findings come as the library returns them, sorted. A
|
|
65
|
+
``service`` the ontology does not declare gets the library's one
|
|
66
|
+
information finding and one warning for each contract that writes a
|
|
67
|
+
binding.
|
|
68
|
+
|
|
69
|
+
Raises ``ContractError`` when ``ontology_path`` cannot be read or is not an
|
|
70
|
+
ontology (see :func:`_read_ontology`), when the ``ontology`` rule finds an
|
|
71
|
+
error in the file, whatever ``service`` is (the message is ``<file>: the
|
|
72
|
+
ontology file has <n> error(s): run continuo-contracts ontology check
|
|
73
|
+
<file>``, and no contract is read against the file), and when ``service``
|
|
74
|
+
is blank. Findings of the ``ontology`` rule that are not errors do not stop
|
|
75
|
+
the check.
|
|
76
|
+
"""
|
|
77
|
+
loaded = _read_ontology(ontology_path)
|
|
78
|
+
broken = sum(finding.severity == "error" for finding in ontology_findings(loaded))
|
|
79
|
+
if broken:
|
|
80
|
+
raise ContractError(
|
|
81
|
+
f"{ontology_path}: the ontology file has {broken} error(s): "
|
|
82
|
+
f"run continuo-contracts ontology check {ontology_path}"
|
|
83
|
+
)
|
|
84
|
+
try:
|
|
85
|
+
stored = [normalise_python(doc, service=service, reads=[]) for doc in docs]
|
|
86
|
+
except ContractsError as exc:
|
|
87
|
+
raise ContractError(str(exc)) from None
|
|
88
|
+
resolved = [ontology.resolve(contract, loaded) for contract in stored]
|
|
89
|
+
return check(loaded, resolved, rules=PER_SERVICE_RULES)
|
{continuo_python_runtime-0.13.0.dist-info → continuo_python_runtime-0.14.0.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: continuo-python-runtime
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.14.0
|
|
4
4
|
Summary: Runtime harness, contract tooling, and CI lint for Continuo python nodes.
|
|
5
5
|
Author: Simone Carolini
|
|
6
6
|
Maintainer: Simone Carolini
|
|
@@ -12,7 +12,7 @@ Classifier: Intended Audience :: Developers
|
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.14
|
|
13
13
|
Requires-Python: >=3.14
|
|
14
14
|
Requires-Dist: boto3==1.43.114
|
|
15
|
-
Requires-Dist: continuo-contracts==0.
|
|
15
|
+
Requires-Dist: continuo-contracts==0.4.1
|
|
16
16
|
Requires-Dist: continuo-engine-contract==0.10.0
|
|
17
17
|
Requires-Dist: pyarrow==26.0.0
|
|
18
18
|
Requires-Dist: pyyaml==6.0.3
|
|
@@ -197,7 +197,10 @@ schema:
|
|
|
197
197
|
`vendor: continuo`. Every node sets `schedule` and `criticality`
|
|
198
198
|
(`REGULATORY`, `CORE` or `SECONDARY`); the node's kind decides the rest
|
|
199
199
|
(see "Node kinds" below). An optional `service` names the node's service,
|
|
200
|
-
and `pack`
|
|
200
|
+
and `pack` and `validate --service` refuse a contract whose `service` is not
|
|
201
|
+
their `--service`.
|
|
202
|
+
- A contract may also bind its table and its columns to the company's ontology
|
|
203
|
+
(see "Checking against the ontology" below).
|
|
201
204
|
- The contract has exactly one schema object, `physicalType: table`. Its
|
|
202
205
|
`properties` are the table's columns, in order: each has a `name`, a
|
|
203
206
|
`physicalType` (`BIGINT`, `INTEGER` or `INT`, `DOUBLE PRECISION`,
|
|
@@ -236,6 +239,86 @@ The harness does not run these read checks again when a node starts, so a
|
|
|
236
239
|
read that passes here is not judged again under a different grammar in
|
|
237
240
|
production. See `docs/boundary-contract.md` §13.1.
|
|
238
241
|
|
|
242
|
+
### Checking against the ontology
|
|
243
|
+
|
|
244
|
+
A company that keeps an ontology file, the things its data is about and the
|
|
245
|
+
services that own them, can have each contract bind its table and its columns
|
|
246
|
+
to it. The bindings are optional `continuo` properties: `entity`, `grain`,
|
|
247
|
+
`fixed` and `filter` on the schema object, and `property`, `local` and
|
|
248
|
+
`aggregate` on a column (`docs/boundary-contract.md` gives their values):
|
|
249
|
+
|
|
250
|
+
```yaml
|
|
251
|
+
schema:
|
|
252
|
+
- name: example
|
|
253
|
+
physicalType: table
|
|
254
|
+
customProperties:
|
|
255
|
+
- {vendor: continuo, property: entity, value: Order}
|
|
256
|
+
properties:
|
|
257
|
+
- name: order_id
|
|
258
|
+
physicalType: INTEGER
|
|
259
|
+
required: true
|
|
260
|
+
customProperties:
|
|
261
|
+
- {vendor: continuo, property: property, value: Order.order_id}
|
|
262
|
+
- name: note
|
|
263
|
+
physicalType: "VARCHAR(64)"
|
|
264
|
+
customProperties:
|
|
265
|
+
- {vendor: continuo, property: local, value: true}
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
If `Order` has a key part or a property named `order_id`, the check would bind
|
|
269
|
+
that column itself; the binding is written out for clarity.
|
|
270
|
+
|
|
271
|
+
A contract with bindings loads, validates, packs and runs like any other, and
|
|
272
|
+
its `content_hash` is the one it has without them. To check the bindings in your
|
|
273
|
+
CI, keep a copy of the company's ontology file in your own repository, for
|
|
274
|
+
example at `ontology/ontology.yaml`, and give `validate` the name of your
|
|
275
|
+
service and the path of that copy:
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
continuo-runtime validate contracts --service <name> --ontology ontology/ontology.yaml
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
Copy the file from the company's ontology repository, never from continuo, and
|
|
282
|
+
keep it outside `contracts/`, where `validate` refuses any other YAML file. The
|
|
283
|
+
copy is yours to keep current: when the ontology changes, you update it. A copy
|
|
284
|
+
that is behind the ontology can pass here and still be refused by the release,
|
|
285
|
+
which checks against the ontology the install runs. The library's dbt check,
|
|
286
|
+
`continuo-contracts dbt check`, takes the same file with `--ontology`.
|
|
287
|
+
|
|
288
|
+
`--service` alone refuses a contract whose `service` property names another
|
|
289
|
+
service. `--ontology` needs `--service`; without it `validate` exits 2. With
|
|
290
|
+
both, every contract is checked as a contract of that service by the rules of
|
|
291
|
+
`continuo-contracts` that need no other service: `contract`, `coverage`,
|
|
292
|
+
`quality` and `privacy`. The rules that read the whole estate (`access`,
|
|
293
|
+
`order` and `drift`) cannot run on one service's contracts and are not run
|
|
294
|
+
here. `validate` logs, on stderr and at the level of its severity (ERROR,
|
|
295
|
+
WARNING or INFO), one line for each finding,
|
|
296
|
+
`<severity> [<rule>] <subject>: <message>`, then one INFO line that counts them,
|
|
297
|
+
`<e> error(s), <w> warning(s), <i> info: <name>`. It exits 1 when any finding is
|
|
298
|
+
an error and 0 otherwise, and it prints nothing to stdout.
|
|
299
|
+
|
|
300
|
+
- When the ontology declares the service, each contract names exactly one of
|
|
301
|
+
`entity` or `grain`, so a contract that names neither, or both, is an error.
|
|
302
|
+
A column that carries no binding is a warning, unless its name is a key part
|
|
303
|
+
or a property of the table's entity, in which case the check binds it itself.
|
|
304
|
+
- When the ontology does not declare the service, none of its contracts is
|
|
305
|
+
checked: `validate` logs one INFO line, `not declared in the ontology: none
|
|
306
|
+
of this service's contracts is checked`, and one WARNING for each contract
|
|
307
|
+
that writes bindings, and exits 0.
|
|
308
|
+
- A file that cannot be read, is not UTF-8 text or is not an ontology is one
|
|
309
|
+
ERROR line, `<file>: <reason>`, and exit 1. The reason of an invalid
|
|
310
|
+
ontology is the library's, with the path to the first fault.
|
|
311
|
+
- A file that is an ontology but that the library's `ontology` rule refuses (a
|
|
312
|
+
thing owned by a domain the file does not declare, a service of a domain it
|
|
313
|
+
does not declare, a personal property no access rule names) is refused the
|
|
314
|
+
same way, whatever the service, and no contract is checked against it: one
|
|
315
|
+
ERROR line, `<file>: the ontology file has <n> error(s): run
|
|
316
|
+
continuo-contracts ontology check <file>`, and exit 1. That command lists the
|
|
317
|
+
errors. Findings of that rule that are not errors do not stop the check.
|
|
318
|
+
|
|
319
|
+
A company without an ontology adds nothing: without the two flags `validate`
|
|
320
|
+
runs the checks above and no others.
|
|
321
|
+
|
|
239
322
|
## Node kinds
|
|
240
323
|
|
|
241
324
|
The `kind` property (a `customProperties` item, not the contract's root
|
|
@@ -471,11 +554,11 @@ A domain repo picks its warehouse engine by which base image it builds
|
|
|
471
554
|
`FROM`:
|
|
472
555
|
|
|
473
556
|
```dockerfile
|
|
474
|
-
FROM ghcr.io/carolsimone/continuo-python-runtime-postgres:v0.
|
|
557
|
+
FROM ghcr.io/carolsimone/continuo-python-runtime-postgres:v0.14.0
|
|
475
558
|
# or
|
|
476
|
-
FROM ghcr.io/carolsimone/continuo-python-runtime-trino:v0.
|
|
559
|
+
FROM ghcr.io/carolsimone/continuo-python-runtime-trino:v0.14.0
|
|
477
560
|
# or
|
|
478
|
-
FROM ghcr.io/carolsimone/continuo-python-runtime-duckdb:v0.
|
|
561
|
+
FROM ghcr.io/carolsimone/continuo-python-runtime-duckdb:v0.14.0
|
|
479
562
|
```
|
|
480
563
|
|
|
481
564
|
The engine is part of the image **name**; the tag is the bare version, so
|
{continuo_python_runtime-0.13.0.dist-info → continuo_python_runtime-0.14.0.dist-info}/RECORD
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
continuo_python_runtime/__init__.py,sha256=otNaXEPsTtRXJV5FLtDUsFO8VD4OC-MLAzwhtimHfOE,70
|
|
2
|
-
continuo_python_runtime/cli.py,sha256=
|
|
2
|
+
continuo_python_runtime/cli.py,sha256=cBrtT5FfOscsPsqBS0HhYYAC-GXCN8pqqBq_1wAmwYI,11331
|
|
3
3
|
continuo_python_runtime/closure.py,sha256=6e-IAQp8Lieb0bGKP1F6JE4TgVBJ_COTGXRUult2xeI,12991
|
|
4
4
|
continuo_python_runtime/conform.py,sha256=a9CKCA-gT9Zerzr6c5H8aByTFOUd6uBMo02sNKSDnXg,9199
|
|
5
5
|
continuo_python_runtime/content_check.py,sha256=FbngEt-lEwpfxO-qrhsDWXbBignmpP3ATLQ4hdkcWR4,2972
|
|
@@ -16,8 +16,9 @@ continuo_python_runtime/shape.py,sha256=C-5ClSxPYgoO9pUiGqw7pCnmlBbsEl-sIm7Twbf-
|
|
|
16
16
|
continuo_python_runtime/types.py,sha256=_ssxNE2Lq5782n9_Ihs-u_6ybCCy8XaL6iYbE35tBug,5057
|
|
17
17
|
continuo_python_runtime/contract/__init__.py,sha256=S79x6j_P0CmaSuCGzeWoK1U0507KvD2MZXwQl9DFWMM,37
|
|
18
18
|
continuo_python_runtime/contract/kinds.py,sha256=nGX1KdYgENzUETbc48V6ru7qU9K8dOUQ54N05ZRAwf0,6163
|
|
19
|
-
continuo_python_runtime/contract/loader.py,sha256
|
|
19
|
+
continuo_python_runtime/contract/loader.py,sha256=-I_ijjdK2VmYII-Zs-yfyPy_NuZOw6jQN8_T025ySUo,14228
|
|
20
20
|
continuo_python_runtime/contract/model.py,sha256=NCjOZni6n9oEK0K2QyoQcu6D9snefqz1wx2l_M_RgKg,1754
|
|
21
|
+
continuo_python_runtime/contract/ontology_check.py,sha256=cJes2QjeOJSgMzJAeZdi0x6JnPnX4P86XS43pNHRd3M,4150
|
|
21
22
|
continuo_python_runtime/contract/pack.py,sha256=9dcHYohaM4m5MUGD54Zorage2c16XloSEORj2Pl-KWs,12926
|
|
22
23
|
continuo_python_runtime/contract/paths.py,sha256=uncZxz11Lfqom4eXFZeErU3dZUy8ShI9NpmiIJ20Abc,2804
|
|
23
24
|
continuo_python_runtime/contract/read_tables.py,sha256=bz3CHplIh9L3ecUuTudiu4D6y4aGcvdiTbopOkF5C2M,4036
|
|
@@ -28,9 +29,9 @@ continuo_python_runtime/validation/__init__.py,sha256=hz5oGXsoaUoygR0_pBby9PS6cE
|
|
|
28
29
|
continuo_python_runtime/validation/preflight.py,sha256=3DSVbPMPqsYg5yMEEDv_1YedN2_e7aYcSh8d2i7vEf8,16093
|
|
29
30
|
continuo_python_runtime/validation/runner.py,sha256=fsTI_XdFG_LWhv9IrgknLI-_FxM1GQXoLmV7xIoIvF8,15034
|
|
30
31
|
continuo_python_runtime/validation/s3.py,sha256=q8nRrT9R7L1-M4dSlDnkL7CUJMPmq86MHY_UKYFlEf8,1785
|
|
31
|
-
continuo_python_runtime-0.
|
|
32
|
-
continuo_python_runtime-0.
|
|
33
|
-
continuo_python_runtime-0.
|
|
34
|
-
continuo_python_runtime-0.
|
|
35
|
-
continuo_python_runtime-0.
|
|
36
|
-
continuo_python_runtime-0.
|
|
32
|
+
continuo_python_runtime-0.14.0.dist-info/METADATA,sha256=xPC5qK2wxA_jeby70kZH9pf3zBMXtqYCyx_NHT_0iww,39322
|
|
33
|
+
continuo_python_runtime-0.14.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
34
|
+
continuo_python_runtime-0.14.0.dist-info/entry_points.txt,sha256=ZvIwSm9f9B9ZmZMf6CyF5Zt4QONn8rqaIk-u-B1CF2Y,70
|
|
35
|
+
continuo_python_runtime-0.14.0.dist-info/licenses/LICENSE,sha256=hfXfFCk-8gnps4YvHA6bjCNaSYqOrq2gAdqkXYycAQc,11345
|
|
36
|
+
continuo_python_runtime-0.14.0.dist-info/licenses/NOTICE,sha256=ykgYyQkAMx3uas90FZHzt0aTca9IgJQCLpZ4d74Pl3U,465
|
|
37
|
+
continuo_python_runtime-0.14.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|