pytrilogy 0.0.3.85__py3-none-any.whl → 0.0.3.86__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.85.dist-info → pytrilogy-0.0.3.86.dist-info}/METADATA +1 -1
- {pytrilogy-0.0.3.85.dist-info → pytrilogy-0.0.3.86.dist-info}/RECORD +11 -11
- trilogy/__init__.py +1 -1
- trilogy/core/models/author.py +10 -12
- trilogy/dialect/duckdb.py +1 -0
- trilogy/parsing/parse_engine.py +3 -1
- trilogy/parsing/trilogy.lark +1 -1
- {pytrilogy-0.0.3.85.dist-info → pytrilogy-0.0.3.86.dist-info}/WHEEL +0 -0
- {pytrilogy-0.0.3.85.dist-info → pytrilogy-0.0.3.86.dist-info}/entry_points.txt +0 -0
- {pytrilogy-0.0.3.85.dist-info → pytrilogy-0.0.3.86.dist-info}/licenses/LICENSE.md +0 -0
- {pytrilogy-0.0.3.85.dist-info → pytrilogy-0.0.3.86.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.86.dist-info/licenses/LICENSE.md,sha256=5ZRvtTyCCFwz1THxDTjAu3Lidds9WjPvvzgVwPSYNDo,1042
|
|
2
|
+
trilogy/__init__.py,sha256=5dzQ0vpbEueUVSZmFxf4YBdZiiISnPSLYO_1sIGq8Rs,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
|
|
@@ -23,7 +23,7 @@ trilogy/core/optimization.py,sha256=ojpn-p79lr03SSVQbbw74iPCyoYpDYBmj1dbZ3oXCjI,
|
|
|
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=WBrPQh-n7rmKULpJxx0aY1PZAqE2lOKScEttMEuetoc,78263
|
|
27
27
|
trilogy/core/models/build.py,sha256=0TRcL__hvajLcpFwYeLjCV35cow5oVPbJHXA3oO09XA,65931
|
|
28
28
|
trilogy/core/models/build_environment.py,sha256=s_C9xAHuD3yZ26T15pWVBvoqvlp2LdZ8yjsv2_HdXLk,5363
|
|
29
29
|
trilogy/core/models/core.py,sha256=q-8ExAaSB3PoSDX2XOqfZ01HBBvT1pZFs7jGg1vZizc,11096
|
|
@@ -82,7 +82,7 @@ trilogy/dialect/bigquery.py,sha256=8xhEu0z_lKANjbvzvBbC7CeKrJf1iP8YyrHqNale-ug,4
|
|
|
82
82
|
trilogy/dialect/common.py,sha256=tSthIZOXXRPQ4KeMKnDDsH7KlTmf2EVqigVtLyoc4zc,6071
|
|
83
83
|
trilogy/dialect/config.py,sha256=olnyeVU5W5T6b9-dMeNAnvxuPlyc2uefb7FRME094Ec,3834
|
|
84
84
|
trilogy/dialect/dataframe.py,sha256=RUbNgReEa9g3pL6H7fP9lPTrAij5pkqedpZ99D8_5AE,1522
|
|
85
|
-
trilogy/dialect/duckdb.py,sha256=
|
|
85
|
+
trilogy/dialect/duckdb.py,sha256=JoUvQ19WvgxoaJkGLM7DPXOd1H0394k3vBiblksQzOI,5631
|
|
86
86
|
trilogy/dialect/enums.py,sha256=FRNYQ5-w-B6-X0yXKNU5g9GowsMlERFogTC5u2nxL_s,4740
|
|
87
87
|
trilogy/dialect/postgres.py,sha256=el2PKwfyvWGk5EZtLudqAH5ewLitY1sFHJiocBSyxyM,3393
|
|
88
88
|
trilogy/dialect/presto.py,sha256=yzSF8SZ6o1dizj1UueAa7S3lR0qNYJdSXbF78EHyhY0,3668
|
|
@@ -98,9 +98,9 @@ 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=bIrct01a9_BVqyOBge_T3Nbjou3CTapyZufGa7yvzjg,78898
|
|
102
102
|
trilogy/parsing/render.py,sha256=HSNntD82GiiwHT-TWPLXAaIMWLYVV5B5zQEsgwrHIBE,19605
|
|
103
|
-
trilogy/parsing/trilogy.lark,sha256=
|
|
103
|
+
trilogy/parsing/trilogy.lark,sha256=PCcvtvjuadYgUx1dBEuEwjdU4Ey69SBPzs10Pg5BzbU,15388
|
|
104
104
|
trilogy/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
105
105
|
trilogy/scripts/trilogy.py,sha256=1L0XrH4mVHRt1C9T1HnaDv2_kYEfbWTb5_-cBBke79w,3774
|
|
106
106
|
trilogy/std/__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.86.dist-info/METADATA,sha256=flJ_PrQGqM6Q9oa5UxfFX603fEhG40plDOVqE6yiqg8,9589
|
|
115
|
+
pytrilogy-0.0.3.86.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
116
|
+
pytrilogy-0.0.3.86.dist-info/entry_points.txt,sha256=ewBPU2vLnVexZVnB-NrVj-p3E-4vukg83Zk8A55Wp2w,56
|
|
117
|
+
pytrilogy-0.0.3.86.dist-info/top_level.txt,sha256=cAy__NW_eMAa_yT9UnUNlZLFfxcg6eimUAZ184cdNiE,8
|
|
118
|
+
pytrilogy-0.0.3.86.dist-info/RECORD,,
|
trilogy/__init__.py
CHANGED
trilogy/core/models/author.py
CHANGED
|
@@ -637,33 +637,31 @@ class Comparison(ConceptArgs, Mergeable, DataTyped, Namespaced, BaseModel):
|
|
|
637
637
|
|
|
638
638
|
@model_validator(mode="after")
|
|
639
639
|
def validate_comparison(self):
|
|
640
|
+
left_type = arg_to_datatype(self.left)
|
|
641
|
+
right_type = arg_to_datatype(self.right)
|
|
640
642
|
if self.operator in (ComparisonOperator.IS, ComparisonOperator.IS_NOT):
|
|
641
|
-
if self.right != MagicConstants.NULL and DataType.BOOL !=
|
|
642
|
-
self.right
|
|
643
|
-
):
|
|
643
|
+
if self.right != MagicConstants.NULL and DataType.BOOL != right_type:
|
|
644
644
|
raise SyntaxError(
|
|
645
645
|
f"Cannot use {self.operator.value} with non-null or boolean value {self.right}"
|
|
646
646
|
)
|
|
647
647
|
elif self.operator in (ComparisonOperator.IN, ComparisonOperator.NOT_IN):
|
|
648
|
-
|
|
648
|
+
|
|
649
649
|
if isinstance(right_type, ArrayType) and not is_compatible_datatype(
|
|
650
|
-
|
|
650
|
+
left_type, right_type.value_data_type
|
|
651
651
|
):
|
|
652
652
|
raise SyntaxError(
|
|
653
|
-
f"Cannot compare {
|
|
653
|
+
f"Cannot compare {left_type} and {right_type} with operator {self.operator} in {str(self)}"
|
|
654
654
|
)
|
|
655
655
|
elif isinstance(self.right, Concept) and not is_compatible_datatype(
|
|
656
|
-
|
|
656
|
+
left_type, right_type
|
|
657
657
|
):
|
|
658
658
|
raise SyntaxError(
|
|
659
|
-
f"Cannot compare {
|
|
659
|
+
f"Cannot compare {left_type.name} and {right_type.name} with operator {self.operator} in {str(self)}"
|
|
660
660
|
)
|
|
661
661
|
else:
|
|
662
|
-
if not is_compatible_datatype(
|
|
663
|
-
arg_to_datatype(self.left), arg_to_datatype(self.right)
|
|
664
|
-
):
|
|
662
|
+
if not is_compatible_datatype(left_type, right_type):
|
|
665
663
|
raise SyntaxError(
|
|
666
|
-
f"Cannot compare {
|
|
664
|
+
f"Cannot compare {left_type.name} ({self.left}) and {right_type.name} ({self.right}) of different types with operator {self.operator.value} in {str(self)}"
|
|
667
665
|
)
|
|
668
666
|
|
|
669
667
|
return self
|
trilogy/dialect/duckdb.py
CHANGED
|
@@ -76,6 +76,7 @@ FUNCTION_MAP = {
|
|
|
76
76
|
FunctionType.DATE: lambda x: f"cast({x[0]} as date)",
|
|
77
77
|
FunctionType.DATE_TRUNCATE: lambda x: f"date_trunc('{x[1]}', {x[0]})",
|
|
78
78
|
FunctionType.DATE_ADD: lambda x: f"date_add({x[0]}, {x[2]} * INTERVAL 1 {x[1]})",
|
|
79
|
+
FunctionType.DATE_SUB: lambda x: f"date_add({x[0]}, -{x[2]} * INTERVAL 1 {x[1]})",
|
|
79
80
|
FunctionType.DATE_PART: lambda x: f"date_part('{x[1]}', {x[0]})",
|
|
80
81
|
FunctionType.DATE_DIFF: lambda x: f"date_diff('{x[2]}', {x[0]}, {x[1]})",
|
|
81
82
|
FunctionType.CONCAT: lambda x: f"({' || '.join(x)})",
|
trilogy/parsing/parse_engine.py
CHANGED
|
@@ -683,7 +683,9 @@ class ParseToObjects(Transformer):
|
|
|
683
683
|
)
|
|
684
684
|
# let constant purposes exist to support round-tripping
|
|
685
685
|
# as a build concept may end up with a constant based on constant inlining happening recursively
|
|
686
|
-
if
|
|
686
|
+
if purpose == Purpose.KEY and concept.purpose != Purpose.KEY:
|
|
687
|
+
concept.purpose = Purpose.KEY
|
|
688
|
+
elif (
|
|
687
689
|
purpose
|
|
688
690
|
and purpose != Purpose.AUTO
|
|
689
691
|
and concept.purpose != purpose
|
trilogy/parsing/trilogy.lark
CHANGED
|
@@ -367,7 +367,7 @@
|
|
|
367
367
|
fyear: _YEAR expr ")"
|
|
368
368
|
|
|
369
369
|
DATE_PART: "DAY"i | "WEEK"i | "MONTH"i | "QUARTER"i | "YEAR"i | "MINUTE"i | "HOUR"i | "SECOND"i | "DAY_OF_WEEK"i
|
|
370
|
-
_DATE_TRUNC.1: "date_trunc("i
|
|
370
|
+
_DATE_TRUNC.1: "date_trunc("i | "date_truncate("i
|
|
371
371
|
fdate_trunc: _DATE_TRUNC expr "," DATE_PART ")"
|
|
372
372
|
_DATE_PART.1: "date_part("i
|
|
373
373
|
fdate_part: _DATE_PART expr "," DATE_PART ")"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|