pytrilogy 0.0.3.39__py3-none-any.whl → 0.0.3.41__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.39.dist-info → pytrilogy-0.0.3.41.dist-info}/METADATA +1 -1
- {pytrilogy-0.0.3.39.dist-info → pytrilogy-0.0.3.41.dist-info}/RECORD +11 -11
- trilogy/__init__.py +1 -1
- trilogy/core/environment_helpers.py +8 -10
- trilogy/core/models/build.py +3 -2
- trilogy/core/models/environment.py +2 -2
- trilogy/parsing/common.py +6 -0
- {pytrilogy-0.0.3.39.dist-info → pytrilogy-0.0.3.41.dist-info}/WHEEL +0 -0
- {pytrilogy-0.0.3.39.dist-info → pytrilogy-0.0.3.41.dist-info}/entry_points.txt +0 -0
- {pytrilogy-0.0.3.39.dist-info → pytrilogy-0.0.3.41.dist-info}/licenses/LICENSE.md +0 -0
- {pytrilogy-0.0.3.39.dist-info → pytrilogy-0.0.3.41.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.41.dist-info/licenses/LICENSE.md,sha256=5ZRvtTyCCFwz1THxDTjAu3Lidds9WjPvvzgVwPSYNDo,1042
|
|
2
|
+
trilogy/__init__.py,sha256=4qLdjNZwaaPUShk24aEi2JWuFTbRXxd502rsSHiH-tk,303
|
|
3
3
|
trilogy/compiler.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
trilogy/constants.py,sha256=5eQxk1A0pv-TQk3CCvgZCFA9_K-6nxrOm7E5Lxd7KIY,1652
|
|
5
5
|
trilogy/engine.py,sha256=OK2RuqCIUId6yZ5hfF8J1nxGP0AJqHRZiafcowmW0xc,1728
|
|
@@ -13,7 +13,7 @@ trilogy/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
13
13
|
trilogy/core/constants.py,sha256=7XaCpZn5mQmjTobbeBn56SzPWq9eMNDfzfsRU-fP0VE,171
|
|
14
14
|
trilogy/core/enums.py,sha256=JwbWyAHOC2xRTZe2SeEvlIGPvmC1KjcJ4uh1Po5USzQ,7380
|
|
15
15
|
trilogy/core/env_processor.py,sha256=pFsxnluKIusGKx1z7tTnfsd_xZcPy9pZDungkjkyvI0,3170
|
|
16
|
-
trilogy/core/environment_helpers.py,sha256=
|
|
16
|
+
trilogy/core/environment_helpers.py,sha256=UWtF5ZQqFyzHdrjUBEd7c2ZfASBhBWFoa9WkUHBbyHI,9700
|
|
17
17
|
trilogy/core/ergonomics.py,sha256=e-7gE29vPLFdg0_A1smQ7eOrUwKl5VYdxRSTddHweRA,1631
|
|
18
18
|
trilogy/core/exceptions.py,sha256=JPYyBcit3T_pRtlHdtKSeVJkIyWUTozW2aaut25A2xI,673
|
|
19
19
|
trilogy/core/functions.py,sha256=4fEOGgXWDvgrJtCg_5m2Y9iWnHfLbvLQ82RkIMl_1K0,27722
|
|
@@ -23,11 +23,11 @@ trilogy/core/optimization.py,sha256=aihzx4-2-mSjx5td1TDTYGvc7e9Zvy-_xEyhPqLS-Ig,
|
|
|
23
23
|
trilogy/core/query_processor.py,sha256=Vl-u0F0rbqI2liv82yJgiZCB255Kx_KiuzZVHL6aeTM,19459
|
|
24
24
|
trilogy/core/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
25
25
|
trilogy/core/models/author.py,sha256=hS1caD8y7XWRBlHfwgZOrBcz3TisDPba8joFaiEXxX0,77072
|
|
26
|
-
trilogy/core/models/build.py,sha256=
|
|
26
|
+
trilogy/core/models/build.py,sha256=Gz_1s3FZtLww6r8RdYi7MxVhOSMw-mlmUg_tDyqGGwE,61881
|
|
27
27
|
trilogy/core/models/build_environment.py,sha256=s_C9xAHuD3yZ26T15pWVBvoqvlp2LdZ8yjsv2_HdXLk,5363
|
|
28
28
|
trilogy/core/models/core.py,sha256=wx6hJcFECMG-Ij972ADNkr-3nFXkYESr82ObPiC46_U,10875
|
|
29
29
|
trilogy/core/models/datasource.py,sha256=6RjJUd2u4nYmEwFBpJlM9LbHVYDv8iHJxqiBMZqUrwI,9422
|
|
30
|
-
trilogy/core/models/environment.py,sha256=
|
|
30
|
+
trilogy/core/models/environment.py,sha256=AVSrvjNcNX535GhCPtYhCRY2Lp_Hj0tdY3VVt_kZb9Q,27260
|
|
31
31
|
trilogy/core/models/execute.py,sha256=mQm5Gydo2Ph0W7w9wm5dQEarS04PC-IKAgNVsdqOZsQ,34524
|
|
32
32
|
trilogy/core/optimizations/__init__.py,sha256=EBanqTXEzf1ZEYjAneIWoIcxtMDite5-n2dQ5xcfUtg,356
|
|
33
33
|
trilogy/core/optimizations/base_optimization.py,sha256=gzDOKImoFn36k7XBD3ysEYDnbnb6vdVIztUfFQZsGnM,513
|
|
@@ -87,7 +87,7 @@ trilogy/hooks/graph_hook.py,sha256=c-vC-IXoJ_jDmKQjxQyIxyXPOuUcLIURB573gCsAfzQ,2
|
|
|
87
87
|
trilogy/hooks/query_debugger.py,sha256=1npRjww94sPV5RRBBlLqMJRaFkH9vhEY6o828MeoEcw,5583
|
|
88
88
|
trilogy/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
89
89
|
trilogy/parsing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
90
|
-
trilogy/parsing/common.py,sha256=
|
|
90
|
+
trilogy/parsing/common.py,sha256=yZJ0b77viQktG5vi4CS8kz9KXj2K3nAb17bkDrw4-WI,26204
|
|
91
91
|
trilogy/parsing/config.py,sha256=Z-DaefdKhPDmSXLgg5V4pebhSB0h590vI0_VtHnlukI,111
|
|
92
92
|
trilogy/parsing/exceptions.py,sha256=92E5i2frv5hj9wxObJZsZqj5T6bglvPzvdvco_vW1Zk,38
|
|
93
93
|
trilogy/parsing/helpers.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
@@ -102,8 +102,8 @@ trilogy/std/display.preql,sha256=2BbhvqR4rcltyAbOXAUo7SZ_yGFYZgFnurglHMbjW2g,40
|
|
|
102
102
|
trilogy/std/geography.preql,sha256=-fqAGnBL6tR-UtT8DbSek3iMFg66ECR_B_41pODxv-k,504
|
|
103
103
|
trilogy/std/money.preql,sha256=ZHW-csTX-kYbOLmKSO-TcGGgQ-_DMrUXy0BjfuJSFxM,80
|
|
104
104
|
trilogy/std/report.preql,sha256=LbV-XlHdfw0jgnQ8pV7acG95xrd1-p65fVpiIc-S7W4,202
|
|
105
|
-
pytrilogy-0.0.3.
|
|
106
|
-
pytrilogy-0.0.3.
|
|
107
|
-
pytrilogy-0.0.3.
|
|
108
|
-
pytrilogy-0.0.3.
|
|
109
|
-
pytrilogy-0.0.3.
|
|
105
|
+
pytrilogy-0.0.3.41.dist-info/METADATA,sha256=_O9X1If80dWqTM9fIHAyEluLAvnwvoAfKN12e1YYUJM,9100
|
|
106
|
+
pytrilogy-0.0.3.41.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
|
|
107
|
+
pytrilogy-0.0.3.41.dist-info/entry_points.txt,sha256=ewBPU2vLnVexZVnB-NrVj-p3E-4vukg83Zk8A55Wp2w,56
|
|
108
|
+
pytrilogy-0.0.3.41.dist-info/top_level.txt,sha256=cAy__NW_eMAa_yT9UnUNlZLFfxcg6eimUAZ184cdNiE,8
|
|
109
|
+
pytrilogy-0.0.3.41.dist-info/RECORD,,
|
trilogy/__init__.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from trilogy.constants import DEFAULT_NAMESPACE
|
|
2
2
|
from trilogy.core.enums import ConceptSource, DatePart, FunctionType, Purpose
|
|
3
3
|
from trilogy.core.functions import AttrAccess
|
|
4
|
-
from trilogy.core.models.author import Concept, Function, Metadata, TraitDataType
|
|
4
|
+
from trilogy.core.models.author import Concept, Function, Grain, Metadata, TraitDataType
|
|
5
5
|
from trilogy.core.models.core import DataType, StructType, arg_to_datatype
|
|
6
6
|
from trilogy.core.models.environment import Environment
|
|
7
7
|
from trilogy.parsing.common import Meta
|
|
@@ -67,7 +67,7 @@ def generate_date_concepts(concept: Concept, environment: Environment):
|
|
|
67
67
|
[concept.address],
|
|
68
68
|
),
|
|
69
69
|
metadata=Metadata(
|
|
70
|
-
description=f"Auto-derived from {base_description}. {FUNCTION_DESCRIPTION_MAPS.get(ftype, ftype.value)}
|
|
70
|
+
description=f"Auto-derived from {base_description}. {FUNCTION_DESCRIPTION_MAPS.get(ftype, ftype.value)}",
|
|
71
71
|
line_number=base_line_number,
|
|
72
72
|
concept_source=ConceptSource.AUTO_DERIVED,
|
|
73
73
|
),
|
|
@@ -89,7 +89,7 @@ def generate_date_concepts(concept: Concept, environment: Environment):
|
|
|
89
89
|
datatype=DataType.DATE,
|
|
90
90
|
purpose=Purpose.PROPERTY,
|
|
91
91
|
lineage=function,
|
|
92
|
-
grain=concept.grain,
|
|
92
|
+
grain=concept.grain.model_copy(),
|
|
93
93
|
namespace=concept.namespace,
|
|
94
94
|
keys=set(
|
|
95
95
|
[concept.address],
|
|
@@ -137,16 +137,16 @@ def generate_datetime_concepts(concept: Concept, environment: Environment):
|
|
|
137
137
|
)
|
|
138
138
|
new_concept = Concept.model_construct(
|
|
139
139
|
name=f"{concept.name}.{fname}",
|
|
140
|
-
datatype=
|
|
140
|
+
datatype=datatype,
|
|
141
141
|
purpose=default_type,
|
|
142
142
|
lineage=const_function,
|
|
143
|
-
grain=concept.grain,
|
|
143
|
+
grain=concept.grain.model_copy(),
|
|
144
144
|
namespace=concept.namespace,
|
|
145
145
|
keys=set(
|
|
146
146
|
[concept.address],
|
|
147
147
|
),
|
|
148
148
|
metadata=Metadata(
|
|
149
|
-
description=f"Auto-derived from {base_description}. {FUNCTION_DESCRIPTION_MAPS.get(ftype, ftype.value)}
|
|
149
|
+
description=f"Auto-derived from {base_description}. {FUNCTION_DESCRIPTION_MAPS.get(ftype, ftype.value)}",
|
|
150
150
|
line_number=base_line_number,
|
|
151
151
|
concept_source=ConceptSource.AUTO_DERIVED,
|
|
152
152
|
),
|
|
@@ -182,11 +182,9 @@ def generate_key_concepts(concept: Concept, environment: Environment):
|
|
|
182
182
|
datatype=DataType.INTEGER,
|
|
183
183
|
purpose=default_type,
|
|
184
184
|
lineage=const_function,
|
|
185
|
-
grain=
|
|
185
|
+
grain=Grain(),
|
|
186
186
|
namespace=concept.namespace,
|
|
187
|
-
keys=
|
|
188
|
-
concept.address,
|
|
189
|
-
},
|
|
187
|
+
keys=set(),
|
|
190
188
|
metadata=Metadata(
|
|
191
189
|
description=f"Auto-derived integer. The {ftype.value} of {concept.address}, {base_description}",
|
|
192
190
|
line_number=base_line_number,
|
trilogy/core/models/build.py
CHANGED
|
@@ -1697,6 +1697,7 @@ class Factory:
|
|
|
1697
1697
|
|
|
1698
1698
|
@build.register
|
|
1699
1699
|
def _(self, base: WhereClause) -> BuildWhereClause:
|
|
1700
|
+
|
|
1700
1701
|
return BuildWhereClause.model_construct(
|
|
1701
1702
|
conditional=self.build(base.conditional)
|
|
1702
1703
|
)
|
|
@@ -1756,14 +1757,14 @@ class Factory:
|
|
|
1756
1757
|
from trilogy.parsing.common import arbitrary_to_concept
|
|
1757
1758
|
|
|
1758
1759
|
left = base.left
|
|
1759
|
-
if isinstance(left, AggregateWrapper):
|
|
1760
|
+
if isinstance(left, (AggregateWrapper, WindowItem, FilterItem)):
|
|
1760
1761
|
left_c = arbitrary_to_concept(
|
|
1761
1762
|
left,
|
|
1762
1763
|
environment=self.environment,
|
|
1763
1764
|
)
|
|
1764
1765
|
left = left_c # type: ignore
|
|
1765
1766
|
right = base.right
|
|
1766
|
-
if isinstance(right, AggregateWrapper):
|
|
1767
|
+
if isinstance(right, (AggregateWrapper, WindowItem, FilterItem)):
|
|
1767
1768
|
right_c = arbitrary_to_concept(
|
|
1768
1769
|
right,
|
|
1769
1770
|
environment=self.environment,
|
|
@@ -420,9 +420,9 @@ class Environment(BaseModel):
|
|
|
420
420
|
if INTERNAL_NAMESPACE in concept.address:
|
|
421
421
|
continue
|
|
422
422
|
if same_namespace:
|
|
423
|
-
new = self.add_concept(concept)
|
|
423
|
+
new = self.add_concept(concept, add_derived=False)
|
|
424
424
|
else:
|
|
425
|
-
new = self.add_concept(concept.with_namespace(alias))
|
|
425
|
+
new = self.add_concept(concept.with_namespace(alias), add_derived=False)
|
|
426
426
|
|
|
427
427
|
k = address_with_namespace(k, alias)
|
|
428
428
|
# set this explicitly, to handle aliasing
|
trilogy/parsing/common.py
CHANGED
|
@@ -577,6 +577,7 @@ def agg_wrapper_to_concept(
|
|
|
577
577
|
# derivation = Concept.calculate_derivation(parent, Purpose.PROPERTY)
|
|
578
578
|
grain = Grain.from_concepts(parent.by, environment) if parent.by else Grain()
|
|
579
579
|
granularity = Concept.calculate_granularity(Derivation.AGGREGATE, grain, parent)
|
|
580
|
+
|
|
580
581
|
out = Concept(
|
|
581
582
|
name=name,
|
|
582
583
|
datatype=aggfunction.output_datatype,
|
|
@@ -590,6 +591,11 @@ def agg_wrapper_to_concept(
|
|
|
590
591
|
derivation=Derivation.AGGREGATE,
|
|
591
592
|
granularity=granularity,
|
|
592
593
|
)
|
|
594
|
+
for x in parent.function.concept_arguments:
|
|
595
|
+
if x.address == out.address:
|
|
596
|
+
raise InvalidSyntaxException(
|
|
597
|
+
f"Aggregate concept {out.address} cannot reference itself. If defining a new concept in a select, use a new name."
|
|
598
|
+
)
|
|
593
599
|
return out
|
|
594
600
|
|
|
595
601
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|