pytrilogy 0.0.3.88__py3-none-any.whl → 0.0.3.89__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.
Potentially problematic release.
This version of pytrilogy might be problematic. Click here for more details.
- {pytrilogy-0.0.3.88.dist-info → pytrilogy-0.0.3.89.dist-info}/METADATA +1 -1
- {pytrilogy-0.0.3.88.dist-info → pytrilogy-0.0.3.89.dist-info}/RECORD +11 -11
- trilogy/__init__.py +1 -1
- trilogy/core/functions.py +2 -1
- trilogy/core/models/author.py +27 -1
- trilogy/core/models/core.py +13 -0
- trilogy/parsing/parse_engine.py +1 -1
- {pytrilogy-0.0.3.88.dist-info → pytrilogy-0.0.3.89.dist-info}/WHEEL +0 -0
- {pytrilogy-0.0.3.88.dist-info → pytrilogy-0.0.3.89.dist-info}/entry_points.txt +0 -0
- {pytrilogy-0.0.3.88.dist-info → pytrilogy-0.0.3.89.dist-info}/licenses/LICENSE.md +0 -0
- {pytrilogy-0.0.3.88.dist-info → pytrilogy-0.0.3.89.dist-info}/top_level.txt +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
pytrilogy-0.0.3.
|
|
2
|
-
trilogy/__init__.py,sha256=
|
|
1
|
+
pytrilogy-0.0.3.89.dist-info/licenses/LICENSE.md,sha256=5ZRvtTyCCFwz1THxDTjAu3Lidds9WjPvvzgVwPSYNDo,1042
|
|
2
|
+
trilogy/__init__.py,sha256=4z9yJ2J3LXCYhlRTHXCrS6JqfhW_hJ2IO2zM6sLdcV4,303
|
|
3
3
|
trilogy/compiler.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
trilogy/constants.py,sha256=eKb_EJvSqjN9tGbdVEViwdtwwh8fZ3-jpOEDqL71y70,1691
|
|
5
5
|
trilogy/engine.py,sha256=OK2RuqCIUId6yZ5hfF8J1nxGP0AJqHRZiafcowmW0xc,1728
|
|
@@ -16,17 +16,17 @@ trilogy/core/env_processor.py,sha256=pFsxnluKIusGKx1z7tTnfsd_xZcPy9pZDungkjkyvI0
|
|
|
16
16
|
trilogy/core/environment_helpers.py,sha256=VvPIiFemqaLLpIpLIqprfu63K7muZ1YzNg7UZIUph8w,8267
|
|
17
17
|
trilogy/core/ergonomics.py,sha256=e-7gE29vPLFdg0_A1smQ7eOrUwKl5VYdxRSTddHweRA,1631
|
|
18
18
|
trilogy/core/exceptions.py,sha256=jYEduuMehcMkmCpf-OC_taELPZm7qNfeSNzIWkDYScs,707
|
|
19
|
-
trilogy/core/functions.py,sha256=
|
|
19
|
+
trilogy/core/functions.py,sha256=hnfcNjAD-XQ572vEwuUEAdBf8zKFWYwPeHIpESjUpZs,32928
|
|
20
20
|
trilogy/core/graph_models.py,sha256=BYhJzHKSgnZHVLJs1CfsgrxTPHqKqPNeA64RlozGY0A,3498
|
|
21
21
|
trilogy/core/internal.py,sha256=wFx4e1I0mtx159YFShSXeUBSQ82NINtAbOI-92RX4i8,2151
|
|
22
22
|
trilogy/core/optimization.py,sha256=ojpn-p79lr03SSVQbbw74iPCyoYpDYBmj1dbZ3oXCjI,8860
|
|
23
23
|
trilogy/core/query_processor.py,sha256=5aFgv-2LVM1Uku9cR_tFuTRDwyLnxc95bCMAHeFy2AY,20332
|
|
24
24
|
trilogy/core/utility.py,sha256=3VC13uSQWcZNghgt7Ot0ZTeEmNqs__cx122abVq9qhM,410
|
|
25
25
|
trilogy/core/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
26
|
-
trilogy/core/models/author.py,sha256=
|
|
26
|
+
trilogy/core/models/author.py,sha256=wG91OmLZmKXI6K9Kv6VVcpD4l3kzu8kh_miNpGKWCmw,79978
|
|
27
27
|
trilogy/core/models/build.py,sha256=CyrSo4xgU-uDKW3xUVYs5cTk3Z3Z2BMWdGQNHnHZOqU,66127
|
|
28
28
|
trilogy/core/models/build_environment.py,sha256=s_C9xAHuD3yZ26T15pWVBvoqvlp2LdZ8yjsv2_HdXLk,5363
|
|
29
|
-
trilogy/core/models/core.py,sha256=
|
|
29
|
+
trilogy/core/models/core.py,sha256=6pWIL0FPMXECwaEwigNuYkN60YlaspSg7JbBnXx1gw0,12038
|
|
30
30
|
trilogy/core/models/datasource.py,sha256=wogTevZ-9CyUW2a8gjzqMCieircxi-J5lkI7EOAZnck,9596
|
|
31
31
|
trilogy/core/models/environment.py,sha256=0IHSCFf5e5b4LPQN3vmjumtfM1iD1tN4WMoUr0UqxZI,27855
|
|
32
32
|
trilogy/core/models/execute.py,sha256=sVWhjwWull-T6pUJizhrYVGCWHY3eZivVN6KNlhcHig,41839
|
|
@@ -98,7 +98,7 @@ trilogy/parsing/common.py,sha256=yV1AckK0h8u1OFeGQBTMu-wuW5m63c5CcZuPicsTH_w,306
|
|
|
98
98
|
trilogy/parsing/config.py,sha256=Z-DaefdKhPDmSXLgg5V4pebhSB0h590vI0_VtHnlukI,111
|
|
99
99
|
trilogy/parsing/exceptions.py,sha256=Xwwsv2C9kSNv2q-HrrKC1f60JNHShXcCMzstTSEbiCw,154
|
|
100
100
|
trilogy/parsing/helpers.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
101
|
-
trilogy/parsing/parse_engine.py,sha256=
|
|
101
|
+
trilogy/parsing/parse_engine.py,sha256=LOvhHZ92s6Tw_spQK8ev4BdVUrzT2QnvzVhkIVHBe_8,79800
|
|
102
102
|
trilogy/parsing/render.py,sha256=HSNntD82GiiwHT-TWPLXAaIMWLYVV5B5zQEsgwrHIBE,19605
|
|
103
103
|
trilogy/parsing/trilogy.lark,sha256=ySzMMLxyPjn74MjFHZxXPTW-jHW68KLPJpiszPvZaO0,15780
|
|
104
104
|
trilogy/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -111,8 +111,8 @@ trilogy/std/money.preql,sha256=XWwvAV3WxBsHX9zfptoYRnBigcfYwrYtBHXTME0xJuQ,2082
|
|
|
111
111
|
trilogy/std/net.preql,sha256=WZCuvH87_rZntZiuGJMmBDMVKkdhTtxeHOkrXNwJ1EE,416
|
|
112
112
|
trilogy/std/ranking.preql,sha256=LDoZrYyz4g3xsII9XwXfmstZD-_92i1Eox1UqkBIfi8,83
|
|
113
113
|
trilogy/std/report.preql,sha256=LbV-XlHdfw0jgnQ8pV7acG95xrd1-p65fVpiIc-S7W4,202
|
|
114
|
-
pytrilogy-0.0.3.
|
|
115
|
-
pytrilogy-0.0.3.
|
|
116
|
-
pytrilogy-0.0.3.
|
|
117
|
-
pytrilogy-0.0.3.
|
|
118
|
-
pytrilogy-0.0.3.
|
|
114
|
+
pytrilogy-0.0.3.89.dist-info/METADATA,sha256=i-vj95n5yQ7Bn7RqoD6rSWVUF1mtHv9tzaFH0h8TBvk,9589
|
|
115
|
+
pytrilogy-0.0.3.89.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
116
|
+
pytrilogy-0.0.3.89.dist-info/entry_points.txt,sha256=ewBPU2vLnVexZVnB-NrVj-p3E-4vukg83Zk8A55Wp2w,56
|
|
117
|
+
pytrilogy-0.0.3.89.dist-info/top_level.txt,sha256=cAy__NW_eMAa_yT9UnUNlZLFfxcg6eimUAZ184cdNiE,8
|
|
118
|
+
pytrilogy-0.0.3.89.dist-info/RECORD,,
|
trilogy/__init__.py
CHANGED
trilogy/core/functions.py
CHANGED
|
@@ -92,7 +92,7 @@ def get_attr_datatype(
|
|
|
92
92
|
lookup = args[1]
|
|
93
93
|
datatype = arg_to_datatype(arg)
|
|
94
94
|
if isinstance(datatype, StructType):
|
|
95
|
-
return
|
|
95
|
+
return datatype.field_types[lookup]
|
|
96
96
|
return datatype
|
|
97
97
|
|
|
98
98
|
|
|
@@ -935,6 +935,7 @@ class FunctionFactory:
|
|
|
935
935
|
output_purpose = Purpose.METRIC
|
|
936
936
|
else:
|
|
937
937
|
output_purpose = Purpose.PROPERTY
|
|
938
|
+
|
|
938
939
|
return Function(
|
|
939
940
|
operator=operator,
|
|
940
941
|
arguments=full_args, # type: ignore
|
trilogy/core/models/author.py
CHANGED
|
@@ -172,11 +172,16 @@ class ConceptRef(Addressable, Namespaced, DataTyped, Mergeable, BaseModel):
|
|
|
172
172
|
for candidate in candidates:
|
|
173
173
|
if not candidate.startswith(f"{source}."):
|
|
174
174
|
continue
|
|
175
|
+
attribute = self.address.rsplit(".", 1)[1]
|
|
176
|
+
dtype = arg_to_datatype(target)
|
|
177
|
+
if not isinstance(dtype, StructType):
|
|
178
|
+
continue
|
|
179
|
+
output_type = dtype.field_types.get(attribute, DataType.UNKNOWN)
|
|
175
180
|
return Function(
|
|
176
181
|
arguments=[target, self.address.rsplit(".", 1)[1]],
|
|
177
182
|
operator=FunctionType.ATTR_ACCESS,
|
|
178
183
|
arg_count=2,
|
|
179
|
-
output_datatype=
|
|
184
|
+
output_datatype=output_type,
|
|
180
185
|
output_purpose=Purpose.PROPERTY,
|
|
181
186
|
)
|
|
182
187
|
return self
|
|
@@ -1637,6 +1642,9 @@ class Function(DataTyped, ConceptArgs, Mergeable, Namespaced, BaseModel):
|
|
|
1637
1642
|
] = None
|
|
1638
1643
|
arguments: Sequence[FuncArgs]
|
|
1639
1644
|
|
|
1645
|
+
class Config:
|
|
1646
|
+
frozen = True
|
|
1647
|
+
|
|
1640
1648
|
def __repr__(self):
|
|
1641
1649
|
return f'{self.operator.value}({",".join([str(a) for a in self.arguments])})'
|
|
1642
1650
|
|
|
@@ -1647,6 +1655,16 @@ class Function(DataTyped, ConceptArgs, Mergeable, Namespaced, BaseModel):
|
|
|
1647
1655
|
def datatype(self):
|
|
1648
1656
|
return self.output_datatype
|
|
1649
1657
|
|
|
1658
|
+
@field_validator("output_datatype")
|
|
1659
|
+
@classmethod
|
|
1660
|
+
def parse_output_datatype(cls, v, info: ValidationInfo):
|
|
1661
|
+
values = info.data
|
|
1662
|
+
if values.get("operator") == FunctionType.ATTR_ACCESS:
|
|
1663
|
+
print(v)
|
|
1664
|
+
if isinstance(v, StructType):
|
|
1665
|
+
raise SyntaxError
|
|
1666
|
+
return v
|
|
1667
|
+
|
|
1650
1668
|
@field_validator("arguments", mode="before")
|
|
1651
1669
|
@classmethod
|
|
1652
1670
|
def parse_arguments(cls, v, info: ValidationInfo):
|
|
@@ -1745,8 +1763,16 @@ class Function(DataTyped, ConceptArgs, Mergeable, Namespaced, BaseModel):
|
|
|
1745
1763
|
]
|
|
1746
1764
|
if self.output_datatype == DataType.UNKNOWN:
|
|
1747
1765
|
new_output = merge_datatypes([arg_to_datatype(x) for x in nargs])
|
|
1766
|
+
|
|
1767
|
+
if self.operator == FunctionType.ATTR_ACCESS:
|
|
1768
|
+
if isinstance(new_output, StructType):
|
|
1769
|
+
new_output = new_output.field_types[str(nargs[1])]
|
|
1748
1770
|
else:
|
|
1749
1771
|
new_output = self.output_datatype
|
|
1772
|
+
# this is not ideal - see hacky logic for datatypes above
|
|
1773
|
+
# we need to figure out how to patch properly
|
|
1774
|
+
# should use function factory, but does not have environment access
|
|
1775
|
+
# probably move all datatype resolution to build?
|
|
1750
1776
|
return Function.model_construct(
|
|
1751
1777
|
operator=self.operator,
|
|
1752
1778
|
arguments=nargs,
|
trilogy/core/models/core.py
CHANGED
|
@@ -244,6 +244,19 @@ class StructType(BaseModel):
|
|
|
244
244
|
def value(self):
|
|
245
245
|
return self.data_type.value
|
|
246
246
|
|
|
247
|
+
@property
|
|
248
|
+
def field_types(self) -> Dict[str, CONCRETE_TYPES]:
|
|
249
|
+
out: Dict[str, CONCRETE_TYPES] = {}
|
|
250
|
+
keys = list(self.fields_map.keys())
|
|
251
|
+
for idx, field in enumerate(self.fields):
|
|
252
|
+
if isinstance(field, StructComponent):
|
|
253
|
+
out[field.name] = arg_to_datatype(field.type)
|
|
254
|
+
elif isinstance(field, DataTyped):
|
|
255
|
+
out[keys[idx]] = field.output_datatype
|
|
256
|
+
else:
|
|
257
|
+
out[keys[idx]] = field
|
|
258
|
+
return out
|
|
259
|
+
|
|
247
260
|
def __hash__(self):
|
|
248
261
|
return hash(str(self))
|
|
249
262
|
|
trilogy/parsing/parse_engine.py
CHANGED
|
@@ -701,6 +701,7 @@ class ParseToObjects(Transformer):
|
|
|
701
701
|
environment=self.environment,
|
|
702
702
|
metadata=metadata,
|
|
703
703
|
)
|
|
704
|
+
|
|
704
705
|
# let constant purposes exist to support round-tripping
|
|
705
706
|
# as a build concept may end up with a constant based on constant inlining happening recursively
|
|
706
707
|
if purpose == Purpose.KEY and concept.purpose != Purpose.KEY:
|
|
@@ -922,7 +923,6 @@ class ParseToObjects(Transformer):
|
|
|
922
923
|
name=output,
|
|
923
924
|
metadata=metadata,
|
|
924
925
|
)
|
|
925
|
-
|
|
926
926
|
return ConceptTransform(function=transformation, output=concept)
|
|
927
927
|
|
|
928
928
|
@v_args(meta=True)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|