umf-access 0.1.0.dev8__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 (117) hide show
  1. umf_access/__init__.py +109 -0
  2. umf_access/adoption.py +41 -0
  3. umf_access/build/__init__.py +2 -0
  4. umf_access/build/approximate.py +34 -0
  5. umf_access/build/catalog.py +1626 -0
  6. umf_access/build/commands.py +394 -0
  7. umf_access/build/pg_privileges.py +1544 -0
  8. umf_access/build/privileges.py +134 -0
  9. umf_access/build/search.py +365 -0
  10. umf_access/build/unity_search.py +104 -0
  11. umf_access/bulk.py +227 -0
  12. umf_access/canonical.py +23 -0
  13. umf_access/capture.py +410 -0
  14. umf_access/catalog.py +325 -0
  15. umf_access/codec_support.py +427 -0
  16. umf_access/commands.py +93 -0
  17. umf_access/delta_read.py +758 -0
  18. umf_access/dsl/__init__.py +148 -0
  19. umf_access/dsl/_context.py +36 -0
  20. umf_access/dsl/_expressions.py +625 -0
  21. umf_access/dsl/_joined.py +4 -0
  22. umf_access/dsl/_nodes.py +207 -0
  23. umf_access/dsl/_query.py +5559 -0
  24. umf_access/dsl/_selection.py +143 -0
  25. umf_access/dsl/navigation.py +302 -0
  26. umf_access/dsl/render.py +516 -0
  27. umf_access/dsl/search.py +343 -0
  28. umf_access/engine_catalog.py +563 -0
  29. umf_access/generated_core.py +5 -0
  30. umf_access/lifecycle/__init__.py +46 -0
  31. umf_access/lifecycle/_darwin_process_observer.c +306 -0
  32. umf_access/lifecycle/approval.py +366 -0
  33. umf_access/lifecycle/backfills.py +79 -0
  34. umf_access/lifecycle/catalog.py +289 -0
  35. umf_access/lifecycle/cli.py +231 -0
  36. umf_access/lifecycle/concurrent.py +196 -0
  37. umf_access/lifecycle/conversion_policy.py +188 -0
  38. umf_access/lifecycle/correspondence.py +203 -0
  39. umf_access/lifecycle/generation_authority_bootstrap.py +1491 -0
  40. umf_access/lifecycle/generation_authority_session.py +125 -0
  41. umf_access/lifecycle/generation_enrollment_authority.py +1108 -0
  42. umf_access/lifecycle/generation_enrollment_ledger.py +698 -0
  43. umf_access/lifecycle/generation_ingress.py +185 -0
  44. umf_access/lifecycle/generation_root_registry.py +138 -0
  45. umf_access/lifecycle/head.py +250 -0
  46. umf_access/lifecycle/head_view.py +81 -0
  47. umf_access/lifecycle/host.py +1183 -0
  48. umf_access/lifecycle/ingress_custody.py +750 -0
  49. umf_access/lifecycle/ingress_local_postgres.py +7990 -0
  50. umf_access/lifecycle/ingress_store.py +1488 -0
  51. umf_access/lifecycle/ledger.py +276 -0
  52. umf_access/lifecycle/ledger_schema.py +116 -0
  53. umf_access/lifecycle/mixed.py +593 -0
  54. umf_access/lifecycle/outcome_schema.py +136 -0
  55. umf_access/lifecycle/owner_approval_core.py +1810 -0
  56. umf_access/lifecycle/owner_authority.py +472 -0
  57. umf_access/lifecycle/owner_bootstrap.py +2077 -0
  58. umf_access/lifecycle/owner_wire.py +161 -0
  59. umf_access/lifecycle/phase_fence.py +52 -0
  60. umf_access/lifecycle/phase_policy.py +422 -0
  61. umf_access/lifecycle/privileges.py +145 -0
  62. umf_access/lifecycle/probe.py +39 -0
  63. umf_access/lifecycle/progress.py +497 -0
  64. umf_access/lifecycle/roles.py +96 -0
  65. umf_access/lifecycle/row_originals.py +1712 -0
  66. umf_access/lifecycle/row_originals_creation.py +759 -0
  67. umf_access/lifecycle/row_originals_receipt.py +413 -0
  68. umf_access/lifecycle/seeds.py +99 -0
  69. umf_access/lifecycle/sql_containment.py +358 -0
  70. umf_access/lifecycle/sql_containment_cli.py +33 -0
  71. umf_access/lifecycle/sql_containment_parser.py +20 -0
  72. umf_access/lifecycle/supervisor_journal_codec.py +1251 -0
  73. umf_access/lifecycle/table_boundary.py +22 -0
  74. umf_access/lifecycle/target_custody_codec.py +788 -0
  75. umf_access/lifecycle/witness.py +72 -0
  76. umf_access/managed_actions.py +271 -0
  77. umf_access/managed_bulk.py +353 -0
  78. umf_access/managed_delta.py +150 -0
  79. umf_access/managed_support.py +166 -0
  80. umf_access/manifest_commands.py +278 -0
  81. umf_access/native_actions.py +1007 -0
  82. umf_access/native_program.py +570 -0
  83. umf_access/pages.py +125 -0
  84. umf_access/postgres_bulk.py +509 -0
  85. umf_access/postgres_read.py +1230 -0
  86. umf_access/postgres_search.py +639 -0
  87. umf_access/protocols.py +665 -0
  88. umf_access/py.typed +0 -0
  89. umf_access/related_keys.py +233 -0
  90. umf_access/reviewed.py +706 -0
  91. umf_access/search_catalog.py +122 -0
  92. umf_access/targets.py +312 -0
  93. umf_access/types.py +220 -0
  94. umf_access/unified/__init__.py +187 -0
  95. umf_access/unified/_binding.py +654 -0
  96. umf_access/unified/head_session.py +144 -0
  97. umf_access/unified/native_binding.py +143 -0
  98. umf_access/unified/operation_values.py +173 -0
  99. umf_access/unified/outcome_values.py +76 -0
  100. umf_access/unified/session_async.py +161 -0
  101. umf_access/unified/session_binding.py +108 -0
  102. umf_access/unified/session_policy.py +152 -0
  103. umf_access/unified/session_psycopg2.py +70 -0
  104. umf_access/unified/session_sqlalchemy.py +161 -0
  105. umf_access/unified/session_sync.py +148 -0
  106. umf_access/unified/table_reads.py +314 -0
  107. umf_access/unified/table_writes.py +193 -0
  108. umf_access/unity_search.py +312 -0
  109. umf_access/values.py +280 -0
  110. umf_access/verification.py +64 -0
  111. umf_access-0.1.0.dev8.dist-info/METADATA +15 -0
  112. umf_access-0.1.0.dev8.dist-info/RECORD +117 -0
  113. umf_access-0.1.0.dev8.dist-info/WHEEL +4 -0
  114. umf_access-0.1.0.dev8.dist-info/entry_points.txt +4 -0
  115. umf_access-0.1.0.dev8.dist-info/licenses/LICENSE-APACHE +201 -0
  116. umf_access-0.1.0.dev8.dist-info/licenses/LICENSE-MIT +21 -0
  117. umf_access-0.1.0.dev8.dist-info/licenses/LICENSE.md +239 -0
umf_access/__init__.py ADDED
@@ -0,0 +1,109 @@
1
+ # SPDX-License-Identifier: MIT OR Apache-2.0
2
+ """Typed access runtime; capability qualification is recorded per build profile."""
3
+
4
+ from .capture import (
5
+ CapturedDeclaration as CapturedDeclaration,
6
+ )
7
+ from .capture import (
8
+ CapturedVariant as CapturedVariant,
9
+ )
10
+ from .capture import (
11
+ CaptureError as CaptureError,
12
+ )
13
+ from .capture import (
14
+ capture as capture,
15
+ )
16
+ from .dsl import (
17
+ Column as Column,
18
+ )
19
+ from .dsl import (
20
+ Continuation as Continuation,
21
+ )
22
+ from .dsl import (
23
+ FieldRef as FieldRef,
24
+ )
25
+ from .dsl import Join as Join
26
+ from .dsl import Joined as Joined
27
+ from .dsl import JoinProjection as JoinProjection
28
+ from .dsl import (
29
+ Page as Page,
30
+ )
31
+ from .dsl import (
32
+ Param as Param,
33
+ )
34
+ from .dsl import (
35
+ Predicate as Predicate,
36
+ )
37
+ from .dsl import (
38
+ Query as Query,
39
+ )
40
+ from .dsl import (
41
+ QueryOutsideCatalog as QueryOutsideCatalog,
42
+ )
43
+ from .dsl import (
44
+ RecordRef as RecordRef,
45
+ )
46
+ from .dsl import (
47
+ Related as Related,
48
+ )
49
+ from .dsl import (
50
+ RelatedKeys as RelatedKeys,
51
+ )
52
+ from .dsl import (
53
+ Score as Score,
54
+ )
55
+ from .dsl import (
56
+ Scored as Scored,
57
+ )
58
+ from .dsl import (
59
+ SearchResult as SearchResult,
60
+ )
61
+ from .dsl import (
62
+ Terminal as Terminal,
63
+ )
64
+ from .dsl import (
65
+ WithKeys as WithKeys,
66
+ )
67
+ from .dsl import (
68
+ and_ as and_,
69
+ )
70
+ from .dsl import (
71
+ command as command,
72
+ )
73
+ from .dsl import (
74
+ hybrid as hybrid,
75
+ )
76
+ from .dsl import (
77
+ if_present as if_present,
78
+ )
79
+ from .dsl import (
80
+ not_ as not_,
81
+ )
82
+ from .dsl import (
83
+ or_ as or_,
84
+ )
85
+ from .dsl import (
86
+ query as query,
87
+ )
88
+ from .dsl import (
89
+ rrf as rrf,
90
+ )
91
+ from .dsl import (
92
+ target_defined as target_defined,
93
+ )
94
+ from .pages import StreamLimitReached as StreamLimitReached
95
+ from .reviewed import (
96
+ CatalogRead as CatalogRead,
97
+ )
98
+ from .reviewed import (
99
+ ReadBuildError as ReadBuildError,
100
+ )
101
+ from .reviewed import (
102
+ ReviewedSQL as ReviewedSQL,
103
+ )
104
+ from .reviewed import (
105
+ build_query as build_query,
106
+ )
107
+ from .types import MISSING as MISSING
108
+ from .types import RUNTIME_ABI as RUNTIME_ABI
109
+ from .types import Vector as Vector
umf_access/adoption.py ADDED
@@ -0,0 +1,41 @@
1
+ # SPDX-License-Identifier: MIT OR Apache-2.0
2
+ from __future__ import annotations
3
+
4
+ import hashlib
5
+ import json
6
+ from dataclasses import dataclass
7
+
8
+
9
+ @dataclass(frozen=True)
10
+ class TargetIdentity:
11
+ kind: str
12
+ backend_id: str
13
+ backend_version: str
14
+ target_profile: str
15
+ binding_sha256: str
16
+ platform: tuple[tuple[str, str], ...]
17
+
18
+ context_json: str | None = None
19
+
20
+ def digest(self) -> str:
21
+ value = {
22
+ "kind": self.kind,
23
+ "backendId": self.backend_id,
24
+ "backendVersion": self.backend_version,
25
+ "targetProfile": self.target_profile,
26
+ "bindingSha256": self.binding_sha256,
27
+ "platform": [
28
+ {"name": name, "version": version} for name, version in self.platform
29
+ ],
30
+ }
31
+ if self.context_json is not None:
32
+ value["context"] = json.loads(self.context_json)
33
+ return hashlib.sha256(
34
+ json.dumps(
35
+ value,
36
+ ensure_ascii=False,
37
+ sort_keys=True,
38
+ separators=(",", ":"),
39
+ allow_nan=False,
40
+ ).encode()
41
+ ).hexdigest()
@@ -0,0 +1,2 @@
1
+ # SPDX-License-Identifier: MIT OR Apache-2.0
2
+ """Explicit trusted build-time capture and catalog publication."""
@@ -0,0 +1,34 @@
1
+ # SPDX-License-Identifier: MIT OR Apache-2.0
2
+ """Closed original Spark HLL++ metadata admission; no statistical guarantee added."""
3
+
4
+ from ..native_program import canonical_json
5
+ from ..reviewed import ReadBuildError
6
+
7
+ SPARK_HLL = {
8
+ "algorithm": "HyperLogLog++",
9
+ "backend": "Apache Spark",
10
+ "backendVersion": "4.0.1",
11
+ "documentation": "https://spark.apache.org/docs/4.0.1/api/sql/index.html#approx_count_distinct",
12
+ "error": {"hardBound": False, "kind": "relative-standard-deviation", "value": "0.05"},
13
+ }
14
+
15
+
16
+ def require_approximate_profile(program: object, profile: str | None) -> None:
17
+ """Preserve the owner descriptor, including its explicit absence of a hard bound."""
18
+ reason = "WEFT_BLOCKED: WR-A10 qualified original approximate output profile required"
19
+ if profile != "spark-delta4" or type(program) is not dict or program.get("version") != "weft.raw-read/0.1" or program.get("target") != profile:
20
+ raise ReadBuildError(reason)
21
+ outputs = program.get("outputs")
22
+ if type(outputs) is not list or not outputs:
23
+ raise ReadBuildError(reason)
24
+ found = False
25
+ for output in outputs:
26
+ if type(output) is not dict:
27
+ raise ReadBuildError(reason)
28
+ if "approximate" not in output and "approximation" not in output:
29
+ continue
30
+ if output.get("approximate") is not True or output.get("carrier") != "integer" or output.get("nullable") is not False or canonical_json(output.get("approximation")) != canonical_json(SPARK_HLL):
31
+ raise ReadBuildError(reason)
32
+ found = True
33
+ if not found:
34
+ raise ReadBuildError(reason)