pytrilogy 0.3.149__cp313-cp313-win_amd64.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.
- LICENSE.md +19 -0
- _preql_import_resolver/__init__.py +5 -0
- _preql_import_resolver/_preql_import_resolver.cp313-win_amd64.pyd +0 -0
- pytrilogy-0.3.149.dist-info/METADATA +555 -0
- pytrilogy-0.3.149.dist-info/RECORD +207 -0
- pytrilogy-0.3.149.dist-info/WHEEL +4 -0
- pytrilogy-0.3.149.dist-info/entry_points.txt +2 -0
- pytrilogy-0.3.149.dist-info/licenses/LICENSE.md +19 -0
- trilogy/__init__.py +27 -0
- trilogy/ai/README.md +10 -0
- trilogy/ai/__init__.py +19 -0
- trilogy/ai/constants.py +92 -0
- trilogy/ai/conversation.py +107 -0
- trilogy/ai/enums.py +7 -0
- trilogy/ai/execute.py +50 -0
- trilogy/ai/models.py +34 -0
- trilogy/ai/prompts.py +100 -0
- trilogy/ai/providers/__init__.py +0 -0
- trilogy/ai/providers/anthropic.py +106 -0
- trilogy/ai/providers/base.py +24 -0
- trilogy/ai/providers/google.py +146 -0
- trilogy/ai/providers/openai.py +89 -0
- trilogy/ai/providers/utils.py +68 -0
- trilogy/authoring/README.md +3 -0
- trilogy/authoring/__init__.py +148 -0
- trilogy/constants.py +119 -0
- trilogy/core/README.md +52 -0
- trilogy/core/__init__.py +0 -0
- trilogy/core/constants.py +6 -0
- trilogy/core/enums.py +454 -0
- trilogy/core/env_processor.py +239 -0
- trilogy/core/environment_helpers.py +320 -0
- trilogy/core/ergonomics.py +193 -0
- trilogy/core/exceptions.py +123 -0
- trilogy/core/functions.py +1240 -0
- trilogy/core/graph_models.py +142 -0
- trilogy/core/internal.py +85 -0
- trilogy/core/models/__init__.py +0 -0
- trilogy/core/models/author.py +2670 -0
- trilogy/core/models/build.py +2603 -0
- trilogy/core/models/build_environment.py +165 -0
- trilogy/core/models/core.py +506 -0
- trilogy/core/models/datasource.py +436 -0
- trilogy/core/models/environment.py +756 -0
- trilogy/core/models/execute.py +1213 -0
- trilogy/core/optimization.py +251 -0
- trilogy/core/optimizations/__init__.py +12 -0
- trilogy/core/optimizations/base_optimization.py +17 -0
- trilogy/core/optimizations/hide_unused_concept.py +47 -0
- trilogy/core/optimizations/inline_datasource.py +102 -0
- trilogy/core/optimizations/predicate_pushdown.py +245 -0
- trilogy/core/processing/README.md +94 -0
- trilogy/core/processing/READMEv2.md +121 -0
- trilogy/core/processing/VIRTUAL_UNNEST.md +30 -0
- trilogy/core/processing/__init__.py +0 -0
- trilogy/core/processing/concept_strategies_v3.py +508 -0
- trilogy/core/processing/constants.py +15 -0
- trilogy/core/processing/discovery_node_factory.py +451 -0
- trilogy/core/processing/discovery_utility.py +548 -0
- trilogy/core/processing/discovery_validation.py +167 -0
- trilogy/core/processing/graph_utils.py +43 -0
- trilogy/core/processing/node_generators/README.md +9 -0
- trilogy/core/processing/node_generators/__init__.py +31 -0
- trilogy/core/processing/node_generators/basic_node.py +160 -0
- trilogy/core/processing/node_generators/common.py +270 -0
- trilogy/core/processing/node_generators/constant_node.py +38 -0
- trilogy/core/processing/node_generators/filter_node.py +315 -0
- trilogy/core/processing/node_generators/group_node.py +213 -0
- trilogy/core/processing/node_generators/group_to_node.py +117 -0
- trilogy/core/processing/node_generators/multiselect_node.py +207 -0
- trilogy/core/processing/node_generators/node_merge_node.py +695 -0
- trilogy/core/processing/node_generators/recursive_node.py +88 -0
- trilogy/core/processing/node_generators/rowset_node.py +165 -0
- trilogy/core/processing/node_generators/select_helpers/__init__.py +0 -0
- trilogy/core/processing/node_generators/select_helpers/datasource_injection.py +261 -0
- trilogy/core/processing/node_generators/select_merge_node.py +846 -0
- trilogy/core/processing/node_generators/select_node.py +95 -0
- trilogy/core/processing/node_generators/synonym_node.py +98 -0
- trilogy/core/processing/node_generators/union_node.py +91 -0
- trilogy/core/processing/node_generators/unnest_node.py +182 -0
- trilogy/core/processing/node_generators/window_node.py +201 -0
- trilogy/core/processing/nodes/README.md +28 -0
- trilogy/core/processing/nodes/__init__.py +179 -0
- trilogy/core/processing/nodes/base_node.py +522 -0
- trilogy/core/processing/nodes/filter_node.py +75 -0
- trilogy/core/processing/nodes/group_node.py +194 -0
- trilogy/core/processing/nodes/merge_node.py +420 -0
- trilogy/core/processing/nodes/recursive_node.py +46 -0
- trilogy/core/processing/nodes/select_node_v2.py +242 -0
- trilogy/core/processing/nodes/union_node.py +53 -0
- trilogy/core/processing/nodes/unnest_node.py +62 -0
- trilogy/core/processing/nodes/window_node.py +56 -0
- trilogy/core/processing/utility.py +823 -0
- trilogy/core/query_processor.py +604 -0
- trilogy/core/statements/README.md +35 -0
- trilogy/core/statements/__init__.py +0 -0
- trilogy/core/statements/author.py +536 -0
- trilogy/core/statements/build.py +0 -0
- trilogy/core/statements/common.py +20 -0
- trilogy/core/statements/execute.py +155 -0
- trilogy/core/table_processor.py +66 -0
- trilogy/core/utility.py +8 -0
- trilogy/core/validation/README.md +46 -0
- trilogy/core/validation/__init__.py +0 -0
- trilogy/core/validation/common.py +161 -0
- trilogy/core/validation/concept.py +146 -0
- trilogy/core/validation/datasource.py +227 -0
- trilogy/core/validation/environment.py +73 -0
- trilogy/core/validation/fix.py +256 -0
- trilogy/dialect/__init__.py +32 -0
- trilogy/dialect/base.py +1432 -0
- trilogy/dialect/bigquery.py +314 -0
- trilogy/dialect/common.py +147 -0
- trilogy/dialect/config.py +159 -0
- trilogy/dialect/dataframe.py +50 -0
- trilogy/dialect/duckdb.py +397 -0
- trilogy/dialect/enums.py +151 -0
- trilogy/dialect/metadata.py +173 -0
- trilogy/dialect/mock.py +190 -0
- trilogy/dialect/postgres.py +117 -0
- trilogy/dialect/presto.py +110 -0
- trilogy/dialect/results.py +89 -0
- trilogy/dialect/snowflake.py +129 -0
- trilogy/dialect/sql_server.py +137 -0
- trilogy/engine.py +48 -0
- trilogy/execution/__init__.py +17 -0
- trilogy/execution/config.py +119 -0
- trilogy/execution/state/__init__.py +0 -0
- trilogy/execution/state/exceptions.py +26 -0
- trilogy/execution/state/file_state_store.py +0 -0
- trilogy/execution/state/sqllite_state_store.py +0 -0
- trilogy/execution/state/state_store.py +406 -0
- trilogy/executor.py +692 -0
- trilogy/hooks/__init__.py +4 -0
- trilogy/hooks/base_hook.py +40 -0
- trilogy/hooks/graph_hook.py +135 -0
- trilogy/hooks/query_debugger.py +166 -0
- trilogy/metadata/__init__.py +0 -0
- trilogy/parser.py +10 -0
- trilogy/parsing/README.md +21 -0
- trilogy/parsing/__init__.py +0 -0
- trilogy/parsing/common.py +1069 -0
- trilogy/parsing/config.py +5 -0
- trilogy/parsing/exceptions.py +8 -0
- trilogy/parsing/helpers.py +1 -0
- trilogy/parsing/parse_engine.py +2876 -0
- trilogy/parsing/render.py +775 -0
- trilogy/parsing/trilogy.lark +546 -0
- trilogy/py.typed +0 -0
- trilogy/render.py +45 -0
- trilogy/scripts/README.md +9 -0
- trilogy/scripts/__init__.py +0 -0
- trilogy/scripts/agent.py +41 -0
- trilogy/scripts/agent_info.py +306 -0
- trilogy/scripts/common.py +432 -0
- trilogy/scripts/dependency/Cargo.lock +617 -0
- trilogy/scripts/dependency/Cargo.toml +39 -0
- trilogy/scripts/dependency/README.md +131 -0
- trilogy/scripts/dependency/build.sh +25 -0
- trilogy/scripts/dependency/src/directory_resolver.rs +387 -0
- trilogy/scripts/dependency/src/lib.rs +16 -0
- trilogy/scripts/dependency/src/main.rs +770 -0
- trilogy/scripts/dependency/src/parser.rs +435 -0
- trilogy/scripts/dependency/src/preql.pest +208 -0
- trilogy/scripts/dependency/src/python_bindings.rs +311 -0
- trilogy/scripts/dependency/src/resolver.rs +716 -0
- trilogy/scripts/dependency/tests/base.preql +3 -0
- trilogy/scripts/dependency/tests/cli_integration.rs +377 -0
- trilogy/scripts/dependency/tests/customer.preql +6 -0
- trilogy/scripts/dependency/tests/main.preql +9 -0
- trilogy/scripts/dependency/tests/orders.preql +7 -0
- trilogy/scripts/dependency/tests/test_data/base.preql +9 -0
- trilogy/scripts/dependency/tests/test_data/consumer.preql +1 -0
- trilogy/scripts/dependency.py +323 -0
- trilogy/scripts/display.py +555 -0
- trilogy/scripts/environment.py +59 -0
- trilogy/scripts/fmt.py +32 -0
- trilogy/scripts/ingest.py +487 -0
- trilogy/scripts/ingest_helpers/__init__.py +1 -0
- trilogy/scripts/ingest_helpers/foreign_keys.py +123 -0
- trilogy/scripts/ingest_helpers/formatting.py +93 -0
- trilogy/scripts/ingest_helpers/typing.py +161 -0
- trilogy/scripts/init.py +105 -0
- trilogy/scripts/parallel_execution.py +762 -0
- trilogy/scripts/plan.py +189 -0
- trilogy/scripts/refresh.py +161 -0
- trilogy/scripts/run.py +79 -0
- trilogy/scripts/serve.py +202 -0
- trilogy/scripts/serve_helpers/__init__.py +41 -0
- trilogy/scripts/serve_helpers/file_discovery.py +142 -0
- trilogy/scripts/serve_helpers/index_generation.py +206 -0
- trilogy/scripts/serve_helpers/models.py +38 -0
- trilogy/scripts/single_execution.py +131 -0
- trilogy/scripts/testing.py +143 -0
- trilogy/scripts/trilogy.py +75 -0
- trilogy/std/__init__.py +0 -0
- trilogy/std/color.preql +3 -0
- trilogy/std/date.preql +13 -0
- trilogy/std/display.preql +18 -0
- trilogy/std/geography.preql +22 -0
- trilogy/std/metric.preql +15 -0
- trilogy/std/money.preql +67 -0
- trilogy/std/net.preql +14 -0
- trilogy/std/ranking.preql +7 -0
- trilogy/std/report.preql +5 -0
- trilogy/std/semantic.preql +6 -0
- trilogy/utility.py +34 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
LICENSE.md,sha256=yDfbCcuP86VC238FACRVoW4Y88ikZwYeuRzlMhLAycM,1060
|
|
2
|
+
_preql_import_resolver/__init__.py,sha256=u8p6v_wq7kr8H8ZqwxeGaN1E5LW7rNe6fMjshXjpBcY,171
|
|
3
|
+
_preql_import_resolver/_preql_import_resolver.cp313-win_amd64.pyd,sha256=94upx9fvX7fmT_5b1mHouXwxFKk1BU0AI_5Q_eZqfTI,657408
|
|
4
|
+
pytrilogy-0.3.149.dist-info/METADATA,sha256=j9ICMUSitadxKIXY4Gh7PPsan_tu8zYW_esFe-NuhZo,14120
|
|
5
|
+
pytrilogy-0.3.149.dist-info/WHEEL,sha256=lraoTyulw0EpTbLV2AtR5kXAJRP7w3nUqalBgpOHvcQ,97
|
|
6
|
+
pytrilogy-0.3.149.dist-info/entry_points.txt,sha256=yuRY2xq7kdrpz-vxW0f1NJHKSOkxB-gXoBQVyTWftas,54
|
|
7
|
+
pytrilogy-0.3.149.dist-info/licenses/LICENSE.md,sha256=yDfbCcuP86VC238FACRVoW4Y88ikZwYeuRzlMhLAycM,1060
|
|
8
|
+
trilogy/__init__.py,sha256=km8MjacpXgg1ZdXsJO5NbfrBYv0zCM5KS1FaII6HPmU,757
|
|
9
|
+
trilogy/ai/README.md,sha256=N84wajEuuLL8l_KJMnCs_INHxaMVNzJWIBhPTpyl3Fw,531
|
|
10
|
+
trilogy/ai/__init__.py,sha256=FIPY7uBNxOxJAjU2eUOFDeW1H8Yx2tM5PKaFdOlC6YA,600
|
|
11
|
+
trilogy/ai/constants.py,sha256=F6yOzajQPegYasRDUJYt7wHmUkUyfiThdVUhqKRtd9g,5156
|
|
12
|
+
trilogy/ai/conversation.py,sha256=H_yyKCuTK0xZU87A955qVGq1_oAvijcCZJHSv9YWdlM,4055
|
|
13
|
+
trilogy/ai/enums.py,sha256=P1TuSLixYEUMiABjP4TVR5Xcn7ex5_zhNVNhf2YR594,125
|
|
14
|
+
trilogy/ai/execute.py,sha256=rklYqm6JPe5YvF05yJY6H-TPrzIY61WsqdgF1J9ZTck,1385
|
|
15
|
+
trilogy/ai/models.py,sha256=0pIAoJ8unM0OskPlaqvHcrKZfGRWx2GdK0ysCYROG90,717
|
|
16
|
+
trilogy/ai/prompts.py,sha256=vxzPD8YBKFH5QmUSWLVPnFjv89MOMID6BeiXPGcChLU,4239
|
|
17
|
+
trilogy/ai/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
+
trilogy/ai/providers/anthropic.py,sha256=QsCUKMKGXtEzC39SDoXzXq53GI-VJkEv9zgY4B0wC1A,4205
|
|
19
|
+
trilogy/ai/providers/base.py,sha256=fVZbF5RMjPPZLVSdfo99PBwKI7BAwvGawnVsXfZ1W40,762
|
|
20
|
+
trilogy/ai/providers/google.py,sha256=YBwWGoYlVkSB33NbEtttrvpuNd8WEi---D71Vx6lqpM,5547
|
|
21
|
+
trilogy/ai/providers/openai.py,sha256=OZ2RDLV_B5qxRRnT7Jvb58WAjCzFTvjFL21wVpmnJgc,3382
|
|
22
|
+
trilogy/ai/providers/utils.py,sha256=Aal7DS2_auLNnnsrEy32tgNfV0E4ymPNxCHezGvViMU,2114
|
|
23
|
+
trilogy/authoring/README.md,sha256=M2-tTTw7yqG4RC_gM5kS-Aj0MzvWcakAqNw_KHHlKp8,149
|
|
24
|
+
trilogy/authoring/__init__.py,sha256=_zUadXAax6dtilEd7k2pvTwo1GnDxw4E5pr6iIOJrK0,3386
|
|
25
|
+
trilogy/constants.py,sha256=WqFCTMmsuagQiCmwyXNLCGAaGalc2rJeJ4RLpxDFSDs,2933
|
|
26
|
+
trilogy/core/README.md,sha256=d24HfHPs8nVuhoMYShs9jQgs5WVtykixxSCtuHaqFvw,964
|
|
27
|
+
trilogy/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
28
|
+
trilogy/core/constants.py,sha256=yl7RCnv4ymSZacjk_6Rdw94LVdpOyQBxNTXGjurky8A,250
|
|
29
|
+
trilogy/core/enums.py,sha256=s7_eoeUSutWyefNETe-jHYGVTreUABi3DN0miR1VkKQ,10485
|
|
30
|
+
trilogy/core/env_processor.py,sha256=9WczWYdDMH2a-CBIZABXd8d3FEO-DyewYj7llYCkJ08,8689
|
|
31
|
+
trilogy/core/environment_helpers.py,sha256=iwU2IJhfZog37Mu6OK56t8M_AM0WUfXI1Lv3jhC5B5E,13063
|
|
32
|
+
trilogy/core/ergonomics.py,sha256=CGw-3DYlBh57PrUEzxhI07M8OJJ2z5SjzCktc6qm5RU,1824
|
|
33
|
+
trilogy/core/exceptions.py,sha256=wxvc93vRbLL0mOBTvvx1aNiFGgNHyXpsuXKYQ3oTbrM,3320
|
|
34
|
+
trilogy/core/functions.py,sha256=EVZmCUmeaqYKAIjUMFtqVX2mhj9W3Gm9_6bXbcFyl4o,38507
|
|
35
|
+
trilogy/core/graph_models.py,sha256=QibMp3lwgf9AYIkESC-AFrt5n6NptuWgWS7nUaDeX5Q,4558
|
|
36
|
+
trilogy/core/internal.py,sha256=HzYozH7-Q_9SYL37Z1Dep6YntWjZ53XqtpEljNXk8zo,2766
|
|
37
|
+
trilogy/core/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
38
|
+
trilogy/core/models/author.py,sha256=AVLZ-z9u4wBaIthc5beB-EG8nBbu-N-6Yoj9wvlPAaM,88901
|
|
39
|
+
trilogy/core/models/build.py,sha256=pT7Gzu7QOCqElUgBQXJOEz4L4UYjeoiN7lzlJEE73Lw,84161
|
|
40
|
+
trilogy/core/models/build_environment.py,sha256=HXQnW_uDrph6Qh1XapxLorR6Vc3OWDiw6TvpV4Q1iK0,6989
|
|
41
|
+
trilogy/core/models/core.py,sha256=lv9Eb_vOhMw8LnRqKNH3jpT3WbSslzSgUb8wyYEGC5Q,14192
|
|
42
|
+
trilogy/core/models/datasource.py,sha256=nJG5hzF6R3XQS382aixau4WygW01nY7taaLADEMpfCg,14112
|
|
43
|
+
trilogy/core/models/environment.py,sha256=CUc2tar9CJtLxnkkttremYnV5HmEgUCkuyaS-h_yHt0,26528
|
|
44
|
+
trilogy/core/models/execute.py,sha256=m-RrnYjv4o_PlaSB0r8TGFm8Q6aX6hYFO-hHM764GOI,45297
|
|
45
|
+
trilogy/core/optimization.py,sha256=uoYwZM3iXaDjXF20-kWhmYUypdPS0vDnZtlTNApuRQc,9513
|
|
46
|
+
trilogy/core/optimizations/__init__.py,sha256=BqXZX4fvoQMn5qFH2bGyfBtVEr_8QJvvscr5sn9T6YU,380
|
|
47
|
+
trilogy/core/optimizations/base_optimization.py,sha256=2gwAFfaknZAF9ksfvSI9zfjypBEV7qLfTt9fvepFY4E,530
|
|
48
|
+
trilogy/core/optimizations/hide_unused_concept.py,sha256=3QLbAFwFqzzC_gFr8LYnfBMTZAnUoEYviLeOyJnHBnQ,1922
|
|
49
|
+
trilogy/core/optimizations/inline_datasource.py,sha256=oNSQZY3ELWtnJW2LSdNUkSTHSS_Gz1zysRkpVawfFnA,4431
|
|
50
|
+
trilogy/core/optimizations/predicate_pushdown.py,sha256=ttcCoicQc4sUznJA2TA6hpORqulTsuXZJE_FmoFZ2zU,10031
|
|
51
|
+
trilogy/core/processing/README.md,sha256=9n-ZGFJkqOv82XnCss4YxhIcBXnI8eDSSnTrnVWfLjI,3007
|
|
52
|
+
trilogy/core/processing/READMEv2.md,sha256=nMAKOdadXIRDYl39bBnsWK4P0vqjvNReDh_cQLkoPQI,3074
|
|
53
|
+
trilogy/core/processing/VIRTUAL_UNNEST.md,sha256=5UlEU0om8wYnFas-UV83NJx1K4nge-fgEkN-eO2aZ0k,745
|
|
54
|
+
trilogy/core/processing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
55
|
+
trilogy/core/processing/concept_strategies_v3.py,sha256=EUl5EmmQa0ItDSNKhtGEHqZxS5a9D-sGm60brY3fkkU,19506
|
|
56
|
+
trilogy/core/processing/constants.py,sha256=Z4l70U-_X3aTg_m0ZGMzTq9dWP93YfwNCzn0V98N40A,419
|
|
57
|
+
trilogy/core/processing/discovery_node_factory.py,sha256=Gl-4XpBU_FoSmaYtTuWJWm5Kty2YToOGQUkvC8o_9os,14439
|
|
58
|
+
trilogy/core/processing/discovery_utility.py,sha256=NrUmSylvecXoCnN6qm-s1gzE_WjEc7hcvSFinNOQ8do,21069
|
|
59
|
+
trilogy/core/processing/discovery_validation.py,sha256=nmW5wTlc-PldzEeVvTeOnbrnXYrJzufOCMyXX8p38ic,5531
|
|
60
|
+
trilogy/core/processing/graph_utils.py,sha256=xDfPROOh0st_7279aCtxi5Ym2DWG93b8NERea1O7e1c,1248
|
|
61
|
+
trilogy/core/processing/node_generators/README.md,sha256=DQmwI-sv4RC2G9oswbrYeJzWIH-_oYI9HCQI5st1GLc,340
|
|
62
|
+
trilogy/core/processing/node_generators/__init__.py,sha256=Qrjt5oMPi1YQloOkDwFoCNsdjPo_qVnTR6GN0l8Ta2I,974
|
|
63
|
+
trilogy/core/processing/node_generators/basic_node.py,sha256=jmHkbYUoIPQeF-QokCDwLXjcWq2pNtbUyQzg0e8nHkM,6181
|
|
64
|
+
trilogy/core/processing/node_generators/common.py,sha256=VtLymdFCvufOJTtNIIX_7r-_HWkLr-DPU39wqI9MlwM,9838
|
|
65
|
+
trilogy/core/processing/node_generators/constant_node.py,sha256=T7aHCggpw53xQ3KfSOvUYWPgQFKAX-yxU7Q_4Famo7o,1184
|
|
66
|
+
trilogy/core/processing/node_generators/filter_node.py,sha256=BcE2HklWNqFj1WSj7Qw0Yvl2xPKPcKdcYTGXmA0tkos,11574
|
|
67
|
+
trilogy/core/processing/node_generators/group_node.py,sha256=SOHwYsDQs9sYFwpwSkk-B-Jsp_LvDYRAvcce3wBJOuw,8773
|
|
68
|
+
trilogy/core/processing/node_generators/group_to_node.py,sha256=Vy3hAjHnrqPPhdZmpBpPP77vb1FYEClw4EAvytYZ8UQ,3949
|
|
69
|
+
trilogy/core/processing/node_generators/multiselect_node.py,sha256=NzJU9l2K7A7VAnbotKAW9-93JSHNEQTaqSwuHRKPbHw,7456
|
|
70
|
+
trilogy/core/processing/node_generators/node_merge_node.py,sha256=UQ-C2gqIrDOD5ATsyUo_V8THBfQiIHuNZUcxy2v6eLI,25962
|
|
71
|
+
trilogy/core/processing/node_generators/recursive_node.py,sha256=2NmZYuKjpNkJqYuzdNwAdgTQvPxuDhyYCBhJt2RBTOA,2601
|
|
72
|
+
trilogy/core/processing/node_generators/rowset_node.py,sha256=AMsKRb5uPrpkz33wlSkqqvMn8NDo6vW5MfzxpXi78JA,6108
|
|
73
|
+
trilogy/core/processing/node_generators/select_helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
74
|
+
trilogy/core/processing/node_generators/select_helpers/datasource_injection.py,sha256=A5yjTZQSkYGVyUYtcBBU0UAGQklgTseqsXC9zJfta3w,8485
|
|
75
|
+
trilogy/core/processing/node_generators/select_merge_node.py,sha256=GyLLRM0-K67pIDJR-ulToPL57BDCxwNB0Id1Q8qewYc,31027
|
|
76
|
+
trilogy/core/processing/node_generators/select_node.py,sha256=CYDQCj8FQX1NlqBr7131wFs2sa3pyznI439UZJC423A,3769
|
|
77
|
+
trilogy/core/processing/node_generators/synonym_node.py,sha256=vXR28_32kGaPfQUfANMDE8YiRnitSz1B0pXN1uWvsyY,3864
|
|
78
|
+
trilogy/core/processing/node_generators/union_node.py,sha256=Z1C2wXsJPSJbo7tJ46E27k4B1mx62V3WbSkPoEpQ5xk,2909
|
|
79
|
+
trilogy/core/processing/node_generators/unnest_node.py,sha256=vUj5_v2GwezyTWibB6ccZOKbjKKhEikOUewvHA_a-xw,6411
|
|
80
|
+
trilogy/core/processing/node_generators/window_node.py,sha256=p39RzZshm4732_PCDtVPfd4E-fdUAEUOOylvXer9C0A,6968
|
|
81
|
+
trilogy/core/processing/nodes/README.md,sha256=Sw3zjT1jreBVl8uX2IenjlmGcQm3aQXsqjfla44QHI8,627
|
|
82
|
+
trilogy/core/processing/nodes/__init__.py,sha256=mBxogZe5tHY2tMoCalItHvL18eGO0KHJE3BerZIjJ6E,5666
|
|
83
|
+
trilogy/core/processing/nodes/base_node.py,sha256=Mt1ovmG8MKfIjgVfeIp2o3JgK1ZaZjC6WOS4OeUew8Q,19322
|
|
84
|
+
trilogy/core/processing/nodes/filter_node.py,sha256=7HoBXneqh_BgqHa2T1JkhxT7ch2cEePr8rZ55Us_wPw,2536
|
|
85
|
+
trilogy/core/processing/nodes/group_node.py,sha256=y32i245Iov1gWEkTejehnxcwVtb4VU7_ZqHazT8_BZg,7643
|
|
86
|
+
trilogy/core/processing/nodes/merge_node.py,sha256=r0RyrS1owjEWSQ0Hd78Jkgs8mdz9XNW5e0rIjJYXF8g,16987
|
|
87
|
+
trilogy/core/processing/nodes/recursive_node.py,sha256=EKoHPvo8g7dMq3V0qxwmDEb1HEtP3cC8PZCCN-cSVUg,1572
|
|
88
|
+
trilogy/core/processing/nodes/select_node_v2.py,sha256=LsNGEzwXVQRu-PmbPf-4WGECYeijoPMnLwWi4Hq0dWg,9104
|
|
89
|
+
trilogy/core/processing/nodes/union_node.py,sha256=lw3oF1Z85TU8ytMzjtdLHjzr3PojgBKtJGNj6XI-JYA,1923
|
|
90
|
+
trilogy/core/processing/nodes/unnest_node.py,sha256=neVxqVJrzezS_N73aT1wv9y1zjY2CvO6WoeqcgTBsJk,2243
|
|
91
|
+
trilogy/core/processing/nodes/window_node.py,sha256=RZj-HILTtBpJK33bdxBdPI2FAagWxmdG5QiFgXZ19-I,1766
|
|
92
|
+
trilogy/core/processing/utility.py,sha256=WdipHbACLcfplfSw5F4cFxWaobyAPXb5ryPPXTdikY8,28182
|
|
93
|
+
trilogy/core/query_processor.py,sha256=QL9j371V2c9B0RHJX4d0yqLr2uUUUuDUtXCISEq6dhU,22142
|
|
94
|
+
trilogy/core/statements/README.md,sha256=3vDd1cw5t90LJFHIy5hX_ycUWV56rs_SOuTNEQuTn9U,485
|
|
95
|
+
trilogy/core/statements/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
96
|
+
trilogy/core/statements/author.py,sha256=StfuYwKQIt3gGYLGes-fWIeePy_fw6wjlByh6hSjf_Q,18237
|
|
97
|
+
trilogy/core/statements/build.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
98
|
+
trilogy/core/statements/common.py,sha256=nI6Ls3zq3NbeOEHFJRvhgSF7YcKFiGRQKqAnuvqwqK0,555
|
|
99
|
+
trilogy/core/statements/execute.py,sha256=vsB2c_OYf3M--MPtMZh5AlDCj-p3xou9F76pwVZ-Prs,3569
|
|
100
|
+
trilogy/core/table_processor.py,sha256=xHsGiUfuDma3u9I2yia-5v2v_y_wG05v2N7tkzWEs0U,2246
|
|
101
|
+
trilogy/core/utility.py,sha256=V64ndAoi6_c8YntcxVjlxUDE5ZY2hs-QoAJJ_7x-CPM,418
|
|
102
|
+
trilogy/core/validation/README.md,sha256=bNjczLIrjD0-fcTdO6UFXRGiCvMtXyGu9LU_U8fXCyg,1663
|
|
103
|
+
trilogy/core/validation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
104
|
+
trilogy/core/validation/common.py,sha256=3cRsDmCIin0y1JzcihUAVnZJKstdMx9ZvzEZNceUHUc,4937
|
|
105
|
+
trilogy/core/validation/concept.py,sha256=7-PE2XtiodbVlq2LVbOFT6d_B4WvmFrsCz0Tx6RdyOI,5388
|
|
106
|
+
trilogy/core/validation/datasource.py,sha256=REF21tjrB3qZQBJhZsYOaR09fZqrehxN7yKwGUi2mj4,8056
|
|
107
|
+
trilogy/core/validation/environment.py,sha256=7hxrCA1fdh6L80fNBRGERM4sFdjm_1oj9mivdTetU8M,2908
|
|
108
|
+
trilogy/core/validation/fix.py,sha256=UsRCT3hIj1Np5urHRqX6mVaSAy_9IGa9MAoK-yk08Rc,8752
|
|
109
|
+
trilogy/dialect/__init__.py,sha256=NVPgw9tzVihKaumTI-N4xK308rAaR0ZevpEs0MrEfmk,741
|
|
110
|
+
trilogy/dialect/base.py,sha256=-oRP5ekOHuI7h9FaXLj-_RYtGzwhqEASfz7921fA4SE,62121
|
|
111
|
+
trilogy/dialect/bigquery.py,sha256=W4bMlFzIEJsynlB05TLThvEri-CzZBmOi39YhrSbMf4,11602
|
|
112
|
+
trilogy/dialect/common.py,sha256=0-P-00vKBP-a-KrYWk_x0EOl4sAc1zBclZnpy4UvSWQ,5855
|
|
113
|
+
trilogy/dialect/config.py,sha256=YF7VhdzZ7e0l_vIEesZwTV4TnjTcZZh68V7gjCV01LE,4977
|
|
114
|
+
trilogy/dialect/dataframe.py,sha256=0hwn-SxCKw7PyzxlFcBexrzE8ymaRkFPmlquX6fMNKo,1646
|
|
115
|
+
trilogy/dialect/duckdb.py,sha256=-I97mvoJu-aXtSbjtm5WE1TTNJG2r3Q8U4YKrMYoXqY,14496
|
|
116
|
+
trilogy/dialect/enums.py,sha256=X-34s_22gP9Z4SeSaRN0aI_WSbyjTMnWutK5Ow5cS64,5454
|
|
117
|
+
trilogy/dialect/metadata.py,sha256=n6RJP9kJxwfE4xAcRh4QLRpdONxz6d1Pjw1f1dpi7XA,5899
|
|
118
|
+
trilogy/dialect/mock.py,sha256=f0iS1PBWbpZOYrqWZyUAUrk4SnhYljq7zrnWk_-G8nk,7350
|
|
119
|
+
trilogy/dialect/postgres.py,sha256=HB-u5PPqyUj0eTdKJUGH9jCYGOOqTFUuiXPqqGjzl5s,4552
|
|
120
|
+
trilogy/dialect/presto.py,sha256=JaFDbOMGbyryWgIP6Y-x3G_xua5EWhuE76yv9_Abflg,4307
|
|
121
|
+
trilogy/dialect/results.py,sha256=tHMhBf28awgd8c_MHN87ZFiXppxTalnFCCKBUxaM8Bs,2404
|
|
122
|
+
trilogy/dialect/snowflake.py,sha256=M4dyAWPS3p1t-7f_rydVwv4A2jyktH1xHWwWB0VaXAQ,5028
|
|
123
|
+
trilogy/dialect/sql_server.py,sha256=R2K6NjxZzdMcQPnQ4PS7qvPF9di9nnIDXncr4SVfBZ8,4826
|
|
124
|
+
trilogy/engine.py,sha256=Zr-nP9P_cPRbjjlU_a9zPBpHXmrInZaJckhdD2oTFn0,1031
|
|
125
|
+
trilogy/execution/__init__.py,sha256=jxLs2odmC1PurcazsvirG16_6VRHDPZ2VpxJuIu5d_4,315
|
|
126
|
+
trilogy/execution/config.py,sha256=RvwLTH_Bcrxxthn_HqXBFhw4UN0qZSRdcCmnIi37aNM,4025
|
|
127
|
+
trilogy/execution/state/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
128
|
+
trilogy/execution/state/exceptions.py,sha256=ETkdsX74sFFgz_qN4Vm0i0cEkuTeGsOttroN-G_t4yI,1056
|
|
129
|
+
trilogy/execution/state/file_state_store.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
130
|
+
trilogy/execution/state/sqllite_state_store.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
131
|
+
trilogy/execution/state/state_store.py,sha256=YX3ENXuAByTfjfB8iL0n_MIxms6Qmm19QM8YNhB8PlA,14934
|
|
132
|
+
trilogy/executor.py,sha256=M-ESKgWbg3mzAQbxtG675G1ro-G2x8w7z5z-SLfz8EA,26023
|
|
133
|
+
trilogy/hooks/__init__.py,sha256=JCKfS48OeyP6Br5HkeY9NI3WNSHo5fLNrvaiXGeNwOo,148
|
|
134
|
+
trilogy/hooks/base_hook.py,sha256=g66G3pXR246Lv6s60dYBYuW8_fRPNym95Kh99UR9QEU,1220
|
|
135
|
+
trilogy/hooks/graph_hook.py,sha256=kgX9KmZmcSxf6DpodZrVzh9N8GDmoIgNICHjAFwizPM,4916
|
|
136
|
+
trilogy/hooks/query_debugger.py,sha256=QYowXu0dS5Zxa7k59CTcUCjxdrm-OdbMbI11nGoe3XU,5749
|
|
137
|
+
trilogy/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
138
|
+
trilogy/parser.py,sha256=chyn5TKf-Z_AROFLVsWx4q7jmTbZo-_Ta9b_LTq8BCg,303
|
|
139
|
+
trilogy/parsing/README.md,sha256=MHc0C1_YbQu_9wDipP5VjBsN0qNi7MIThWZ7WVXKt9k,454
|
|
140
|
+
trilogy/parsing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
141
|
+
trilogy/parsing/common.py,sha256=10QkXc9-H_rHhU-ZMns-uGJl0_dEmvKAgCkTcAlSHdw,36603
|
|
142
|
+
trilogy/parsing/config.py,sha256=f_AX8l7cDvlLiMY4nh0a_mQH4gqfhtsRc8fpl9FUWVk,116
|
|
143
|
+
trilogy/parsing/exceptions.py,sha256=zrmselJ9FQ2_6fmHGQWy6gswnc_u0oyCv_EWkPhVau4,162
|
|
144
|
+
trilogy/parsing/helpers.py,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
|
|
145
|
+
trilogy/parsing/parse_engine.py,sha256=Zmb192ulfriKP_5VnxLG-H189XxxxIqFOUZvs2UuTmc,104107
|
|
146
|
+
trilogy/parsing/render.py,sha256=i5Ds2B42tqw4yagMvwVzrI3dZAZwOSaOh7R4VXBlktU,26739
|
|
147
|
+
trilogy/parsing/trilogy.lark,sha256=OV_bB8OTlqvrZKgdoRkthLb2LX72YNb1-EXNEe91a18,19803
|
|
148
|
+
trilogy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
149
|
+
trilogy/render.py,sha256=OiT3SHzVhX_fm4jNvQ_MgzWB4tTV7U5Wk09bw_X-1X4,1772
|
|
150
|
+
trilogy/scripts/README.md,sha256=YVRBszdGx3JnauJn9Ejy0S9z4gFEPT0XHFltycbem58,206
|
|
151
|
+
trilogy/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
152
|
+
trilogy/scripts/agent.py,sha256=f-l2JobnTx3iZUVREFP66mXTeDLbEDdus-n7DuwSycE,1554
|
|
153
|
+
trilogy/scripts/agent_info.py,sha256=UG2rOinGqUAvl_xSCUSjb3t-S4ID4IbsAj-58TneTjw,8128
|
|
154
|
+
trilogy/scripts/common.py,sha256=LlXKndT4ntucHwfUy-aluCue8Aawq7PeH1BaASXMM7U,14830
|
|
155
|
+
trilogy/scripts/dependency.py,sha256=Ln036XPbMr5CTOp1xQA5YcOliz2yPQVcBCcjJOFyZP8,11102
|
|
156
|
+
trilogy/scripts/dependency/Cargo.lock,sha256=u83J2uhxS-BK3bMVhdJkppfwLj1kRK86Ip6olnPEkos,15910
|
|
157
|
+
trilogy/scripts/dependency/Cargo.toml,sha256=S5q1AOzqRuNoXOf3ZxYOsDG3U_xano0C6Ld7u7Ooi8U,841
|
|
158
|
+
trilogy/scripts/dependency/README.md,sha256=PWvM_GO58U___b6eLic1KUYjvCABcnR0Iam8EoavcS0,3729
|
|
159
|
+
trilogy/scripts/dependency/build.sh,sha256=QuAqEeriMV76uj7vuNqMfXAQGKYF6zHinXzEC6mKb4Y,562
|
|
160
|
+
trilogy/scripts/dependency/src/directory_resolver.rs,sha256=3tHuX_0sFtjHZHYitqGVljcVfkdMBsM39vmxBy6jY3A,13674
|
|
161
|
+
trilogy/scripts/dependency/src/lib.rs,sha256=gq4jstm_nuGQhEpDq8uf_dkw3-Ga7aNT-zk02S323T0,498
|
|
162
|
+
trilogy/scripts/dependency/src/main.rs,sha256=fxgllbhKn-yrPNhgaDjbr_As46cOfo3dIQSfq3C0EMk,26085
|
|
163
|
+
trilogy/scripts/dependency/src/parser.rs,sha256=ostUjLVjeVRU10XlTfUHQu_5tKoEHcr6POqgoqiwBnQ,13917
|
|
164
|
+
trilogy/scripts/dependency/src/preql.pest,sha256=ap9e6DaG2vZuT9XZLVSsLk-CZkYDTy7UoQ3_brfhHck,6895
|
|
165
|
+
trilogy/scripts/dependency/src/python_bindings.rs,sha256=ovjFRgd-AksHfIA6_Dh3XlEqbRVyRgeKh_GtCR9Ws7U,12339
|
|
166
|
+
trilogy/scripts/dependency/src/resolver.rs,sha256=nypZoyN7U8hRT1DjuwBoPVN5V9MlRWSmYk9UQk9am0A,25255
|
|
167
|
+
trilogy/scripts/dependency/tests/base.preql,sha256=KYex4yu6m2EO2KOTGafaa0KQvqCpKODli96Z3tBfl3M,98
|
|
168
|
+
trilogy/scripts/dependency/tests/cli_integration.rs,sha256=ldpFwGFKX_dBiZdaM8dkoKKb1gq2VEEkzasoIZxiMEk,10966
|
|
169
|
+
trilogy/scripts/dependency/tests/customer.preql,sha256=mErua1N4KNxtVXYWXl2VgnwfrRxpv95U_3xjHbgDkaw,155
|
|
170
|
+
trilogy/scripts/dependency/tests/main.preql,sha256=76Y_sB_kR5s3qMp9JRKMhe-vsDyhZu8IImbfSAR3TbY,145
|
|
171
|
+
trilogy/scripts/dependency/tests/orders.preql,sha256=qTMTol7sPRPWQPNhBFbtthoeA49Yqgr_7Fnf4mI7F8g,184
|
|
172
|
+
trilogy/scripts/dependency/tests/test_data/base.preql,sha256=Hg9QWoHd7O3bIZ1T9deBxsMgsIfDu46NJozj6g1SaEc,143
|
|
173
|
+
trilogy/scripts/dependency/tests/test_data/consumer.preql,sha256=fNz2bAcIzSD35ZNHZI8QgOsPwozQcLjMcLThSYt-XZQ,14
|
|
174
|
+
trilogy/scripts/display.py,sha256=YlcfG6HHkOmblFqY00VhU2Bpcn5KCOR4QVrjoAyeu5s,18989
|
|
175
|
+
trilogy/scripts/environment.py,sha256=Ekf8U3Q30mxc0b-G1wjbefDcNuQSjjN5LmiBrAqLDIM,1816
|
|
176
|
+
trilogy/scripts/fmt.py,sha256=AESMIPohLJNZ1Vm7OuXDAoJYxQIkOAtqWGfD2esaDyM,1096
|
|
177
|
+
trilogy/scripts/ingest.py,sha256=74TXJUMplyp5fdMhTeGl7VCXDdJFA8T8gHuSPOrRY0w,16436
|
|
178
|
+
trilogy/scripts/ingest_helpers/__init__.py,sha256=3fGxk-YWVJNOKROicRAK7jSF55Ate_qo-FsXlP2ry9g,46
|
|
179
|
+
trilogy/scripts/ingest_helpers/foreign_keys.py,sha256=KIA8-Uu0jd8hKTrqZopPHK5i8zaCjPiZPHZKSFsF_II,4152
|
|
180
|
+
trilogy/scripts/ingest_helpers/formatting.py,sha256=LCGEn022mOSbnb4oNZ7DHskbJdoGSLUNnYiHu30uFH8,2911
|
|
181
|
+
trilogy/scripts/ingest_helpers/typing.py,sha256=nYkuXziPMuoMMdYeFQoRULH0aTaqESa5-ouHO9BZET0,5465
|
|
182
|
+
trilogy/scripts/init.py,sha256=hXioCROmfyUy8XqKAWQWi9QLOcAypdsmYK2uAjfBl_8,2933
|
|
183
|
+
trilogy/scripts/parallel_execution.py,sha256=vlLMMvvWwOXQ_irABWpKOQvhznII8MgVNgUrJT8_8lY,25640
|
|
184
|
+
trilogy/scripts/plan.py,sha256=hffPq-ACruhNDM4W4HEQu8ZGM5jMmxMVU_QjKlPJ844,6572
|
|
185
|
+
trilogy/scripts/refresh.py,sha256=PjZcajCTmFkskQrLxgvPilBlkvWuwHECwp1aJOi-k9g,5039
|
|
186
|
+
trilogy/scripts/run.py,sha256=YRdd-ocV3MZExGD-OZhgoMGz0JbnYIg9--ix74Qn5UY,2260
|
|
187
|
+
trilogy/scripts/serve.py,sha256=GQGM8N_NvAW8DWeXRiKb_d2jGt2WzowtzJT4KKvk0k8,7153
|
|
188
|
+
trilogy/scripts/serve_helpers/__init__.py,sha256=oGUDH6hxXawz7_KVcWNZPtTBCdZznaIY3hNqxBFOAFI,1005
|
|
189
|
+
trilogy/scripts/serve_helpers/file_discovery.py,sha256=I5PqHmY4CD3Bq4iVeiHKpdKWyTBwHQrimuOEvbtvino,4066
|
|
190
|
+
trilogy/scripts/serve_helpers/index_generation.py,sha256=7Z18tFXgRhrInJTSowjP3Oq1j5A04R4FCOODY5P95Xs,7181
|
|
191
|
+
trilogy/scripts/serve_helpers/models.py,sha256=bDaqo1jPt3EoHyY-Kn4NQ-JoYkummnqPPodBZn9sUFo,767
|
|
192
|
+
trilogy/scripts/single_execution.py,sha256=2AcmNryUrJ8wtatifEVkQ7u-UvuBDWQSV74h3bMM6yI,4295
|
|
193
|
+
trilogy/scripts/testing.py,sha256=kRqBom8zWJQT_eZ-LNLEseGN_9VborZd_KV43enOwtw,4281
|
|
194
|
+
trilogy/scripts/trilogy.py,sha256=ZSvyAywbwZgcyw9VPGpjZGposNq6toK8KTgLsXMpLqE,2004
|
|
195
|
+
trilogy/std/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
196
|
+
trilogy/std/color.preql,sha256=-T-o4sOJCGnx9b-3j04NSZnq4xR5g2Y1BLBK3j5LUew,52
|
|
197
|
+
trilogy/std/date.preql,sha256=mzry6cedB7y_HT1NiUBjrMOzwtfUJ_gzvLHLRyjFx2E,201
|
|
198
|
+
trilogy/std/display.preql,sha256=3M_1X676hINpGR_NcbePGxJYG8-BTSnMpfacCbF7kBg,443
|
|
199
|
+
trilogy/std/geography.preql,sha256=bsovBeHYzXllAHPxA4eXHDdPGtkGx9TeOikJSSMm9y8,696
|
|
200
|
+
trilogy/std/metric.preql,sha256=qhV9h0xlHHEJU_pshe-9fooelE8RwQ1udGO-gtGDgBY,435
|
|
201
|
+
trilogy/std/money.preql,sha256=B6p9cKcTeLXii2Oo7QnzHdtRqCHT4LR4iBGUpObFAKI,2148
|
|
202
|
+
trilogy/std/net.preql,sha256=LSSV_wAT3oJ1xY73JzVFHth0DQdBjtWf6nZRqlNbKZ0,429
|
|
203
|
+
trilogy/std/ranking.preql,sha256=RSdtQa7StF67iSw7imqLkSusi5KcRuObpvDUEtH6UIE,114
|
|
204
|
+
trilogy/std/report.preql,sha256=TWLeEImTPBrbeOYyN551_ycBqqP2keKurGcV7hFkNsc,207
|
|
205
|
+
trilogy/std/semantic.preql,sha256=_o6K07rtklKtEdpbF6iiLHI52ZcznY59x8va87hYVgI,100
|
|
206
|
+
trilogy/utility.py,sha256=l1_oenJlv_4Ehyi7p_a3h7qnfCHfcVdrrZOYjWuAW1Y,797
|
|
207
|
+
pytrilogy-0.3.149.dist-info/RECORD,,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright (c) 2023
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
trilogy/__init__.py
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import warnings
|
|
2
|
+
|
|
3
|
+
# Suppress pydantic warning about field shadowing property in parent class.
|
|
4
|
+
# This is intentional - DataTyped ABC defines output_datatype as a property,
|
|
5
|
+
# but concrete pydantic models override it with a field.
|
|
6
|
+
warnings.filterwarnings(
|
|
7
|
+
"ignore",
|
|
8
|
+
message='Field name "output_datatype".*shadows an attribute',
|
|
9
|
+
category=UserWarning,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
from trilogy.constants import CONFIG
|
|
13
|
+
from trilogy.core.models.environment import Environment, EnvironmentConfig
|
|
14
|
+
from trilogy.dialect.enums import Dialects
|
|
15
|
+
from trilogy.executor import Executor
|
|
16
|
+
from trilogy.parser import parse
|
|
17
|
+
|
|
18
|
+
__version__ = "0.3.149"
|
|
19
|
+
|
|
20
|
+
__all__ = [
|
|
21
|
+
"parse",
|
|
22
|
+
"Executor",
|
|
23
|
+
"Dialects",
|
|
24
|
+
"Environment",
|
|
25
|
+
"EnvironmentConfig",
|
|
26
|
+
"CONFIG",
|
|
27
|
+
]
|
trilogy/ai/README.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# AI Interaction Design
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Core primitive is a conversation. Conversations are made up of messages. Messages have roles (user, assistant, system) and content.
|
|
6
|
+
|
|
7
|
+
A provider is used to get an additional response from the AI model. Providers can be swapped out to use different AI services (e.g., OpenAI, Anthropic, etc.).
|
|
8
|
+
|
|
9
|
+
To get out a structured output, like a query, we use a dedicated conversation method to append a message with a parser. This method will handle the validation
|
|
10
|
+
loop and responses to the AI.
|
trilogy/ai/__init__.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from trilogy.ai.conversation import Conversation
|
|
2
|
+
from trilogy.ai.enums import Provider
|
|
3
|
+
from trilogy.ai.execute import text_to_query
|
|
4
|
+
from trilogy.ai.models import LLMMessage
|
|
5
|
+
from trilogy.ai.prompts import create_query_prompt
|
|
6
|
+
from trilogy.ai.providers.anthropic import AnthropicProvider
|
|
7
|
+
from trilogy.ai.providers.google import GoogleProvider
|
|
8
|
+
from trilogy.ai.providers.openai import OpenAIProvider
|
|
9
|
+
|
|
10
|
+
__all__ = [
|
|
11
|
+
"Conversation",
|
|
12
|
+
"LLMMessage",
|
|
13
|
+
"OpenAIProvider",
|
|
14
|
+
"GoogleProvider",
|
|
15
|
+
"AnthropicProvider",
|
|
16
|
+
"create_query_prompt",
|
|
17
|
+
"text_to_query",
|
|
18
|
+
"Provider",
|
|
19
|
+
]
|
trilogy/ai/constants.py
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
from trilogy.core.enums import FunctionClass, FunctionType
|
|
2
|
+
from trilogy.core.functions import FUNCTION_REGISTRY
|
|
3
|
+
|
|
4
|
+
RULE_PROMPT = """Trilogy statements define a semantic model or query. If a user is asking for data, they want a SELECT.
|
|
5
|
+
Semantic model statements:
|
|
6
|
+
- import <> imports a model to reuse. The output of imports will be visible in fields available to use.
|
|
7
|
+
- key|property|auto|metric defines fields locally. The output will also be visible in fields available to use, so you generally don't need to edit these unless requested.
|
|
8
|
+
- datasource statements define a datasource, which is a mapping of fields to a SQL database table. The left side is the SQL column name, the right side is the field name.
|
|
9
|
+
|
|
10
|
+
SELECT RULES:
|
|
11
|
+
- No FROM, JOIN, GROUP BY, SUB SELECTS, DISTINCT, UNION, or SELECT *.
|
|
12
|
+
- All fields exist in a global namespace; field paths look like `order.product.id`. Always use the full path. NEVER include a from clause.
|
|
13
|
+
- If a field has a grain defined, and that grain is not in the query output, aggregate it to get desired result.
|
|
14
|
+
- If a field has a 'alias_for' defined, it is shorthand for that calculation. Use the field name instead of the calculation in your query to be concise.
|
|
15
|
+
- Newly created fields at the output of the select must be aliased with as (e.g. `sum(births) as all_births`).
|
|
16
|
+
- Aliases cannot happen inside calculations or in the where/having/order clause. Never alias fields with existing names. 'sum(revenue) as total_revenue' is valid, but '(sum(births) as total_revenue) +1 as revenue_plus_one' is not.
|
|
17
|
+
- Implicit grouping: NEVER include a group by clause. Grouping is by non-aggregated fields in the SELECT clause.
|
|
18
|
+
- You can dynamically group inline to get groups at different grains - ex: `sum(metric) by dim1, dim2 as sum_by_dim1_dm2` for alternate grouping. If you are grouping a defined aggregate
|
|
19
|
+
- Count must specify a field (no `count(*)`) Counts are automatically deduplicated. Do not ever use DISTINCT.
|
|
20
|
+
- Since there are no underlying tables, sum/count of a constant should always specify a grain field (e.g. `sum(1) by x as count`).
|
|
21
|
+
- Aggregates in SELECT must be filtered via HAVING. Use WHERE for pre-aggregation filters.
|
|
22
|
+
- Use `field ? condition` for inline filters (e.g. `sum(x ? x > 0)`).
|
|
23
|
+
- Always use a reasonable `LIMIT` for final queries unless the request is for a time series or line chart.
|
|
24
|
+
- Window functions: `rank entity [optional over group] by field desc` (e.g. `rank name over state by sum(births) desc as top_name`) Do not use parentheses for over.
|
|
25
|
+
- Functions. All function names have parenthese (e.g. `sum(births)`, `date_part('year', dep_time)`). For no arguments, use empty parentheses (e.g. `current_date()`).
|
|
26
|
+
- For lag/lead, offset is first: lag/lead offset field order by expr asc/desc.
|
|
27
|
+
- For lag/lead with a window clause: lag/lead offset field by window_clause order by expr asc/desc.
|
|
28
|
+
- Use `::type` casting, e.g., `"2020-01-01"::date`.
|
|
29
|
+
- Date_parts have no quotes; use `date_part(order_date, year)` instead of `date_part(order_date, 'year')`.
|
|
30
|
+
- Comments use `#` only, per line.
|
|
31
|
+
- Two example queries: "where year between 1940 and 1950
|
|
32
|
+
select
|
|
33
|
+
name,
|
|
34
|
+
state,
|
|
35
|
+
sum(births) AS all_births,
|
|
36
|
+
sum(births ? state = 'VT') AS vermont_births,
|
|
37
|
+
rank name over state by all_births desc AS state_rank,
|
|
38
|
+
rank name by sum(births) by name desc AS all_rank
|
|
39
|
+
having
|
|
40
|
+
all_rank<11
|
|
41
|
+
and state = 'ID'
|
|
42
|
+
order by
|
|
43
|
+
all_rank asc
|
|
44
|
+
limit 5;", "where dep_time between '2002-01-01'::datetime and '2010-01-31'::datetime
|
|
45
|
+
select
|
|
46
|
+
carrier.name,
|
|
47
|
+
count(id2) AS total_flights,
|
|
48
|
+
total_flights / date_diff(min(dep_time.date), max(dep_time.date), DAY) AS average_daily_flights
|
|
49
|
+
order by
|
|
50
|
+
total_flights desc;"""
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def render_function(function_type: FunctionType, example: str | None = None):
|
|
54
|
+
info = FUNCTION_REGISTRY[function_type]
|
|
55
|
+
|
|
56
|
+
if info.arg_count == -1:
|
|
57
|
+
# Infinite/variable number of arguments
|
|
58
|
+
base = f"{function_type.value}(<arg1>, <arg2>, ..., <argN>)"
|
|
59
|
+
elif info.arg_count == 0:
|
|
60
|
+
# No arguments
|
|
61
|
+
base = f"{function_type.value}()"
|
|
62
|
+
else:
|
|
63
|
+
# Fixed number of arguments
|
|
64
|
+
base = f"{function_type.value}({', '.join([f'<arg{p}>' for p in range(1, info.arg_count + 1)])})"
|
|
65
|
+
|
|
66
|
+
if example:
|
|
67
|
+
base += f" e.g. {example}"
|
|
68
|
+
return base
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
FUNCTION_EXAMPLES = {
|
|
72
|
+
FunctionType.DATE_ADD: "date_add('2020-01-01'::date, month, 1)",
|
|
73
|
+
FunctionType.DATE_DIFF: "date_diff('2020-01-01'::date, '2020-01-02'::date, day)",
|
|
74
|
+
FunctionType.DATE_PART: "date_part('2020-01-01'::date, year)",
|
|
75
|
+
FunctionType.DATE_SUB: "date_sub('2020-01-01'::date, day, 1)",
|
|
76
|
+
FunctionType.DATE_TRUNCATE: "date_trunc('2020-01-01'::date, month)",
|
|
77
|
+
FunctionType.CURRENT_TIMESTAMP: "now()",
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
FUNCTIONS = "\n".join(
|
|
81
|
+
[
|
|
82
|
+
render_function(v, example=FUNCTION_EXAMPLES.get(v))
|
|
83
|
+
for x, v in FunctionType.__members__.items()
|
|
84
|
+
if v in FUNCTION_REGISTRY
|
|
85
|
+
]
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
AGGREGATE_FUNCTIONS = [
|
|
89
|
+
x
|
|
90
|
+
for x, info in FunctionType.__members__.items()
|
|
91
|
+
if x in FunctionClass.AGGREGATE_FUNCTIONS.value
|
|
92
|
+
]
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from typing import Literal, Union
|
|
3
|
+
|
|
4
|
+
from trilogy import Environment
|
|
5
|
+
from trilogy.ai.models import LLMMessage, LLMRequestOptions
|
|
6
|
+
from trilogy.ai.prompts import TRILOGY_LEAD_IN, create_query_prompt
|
|
7
|
+
from trilogy.ai.providers.base import LLMProvider
|
|
8
|
+
from trilogy.core.exceptions import (
|
|
9
|
+
InvalidSyntaxException,
|
|
10
|
+
NoDatasourceException,
|
|
11
|
+
UndefinedConceptException,
|
|
12
|
+
UnresolvableQueryException,
|
|
13
|
+
)
|
|
14
|
+
from trilogy.core.query_processor import process_query
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@dataclass
|
|
18
|
+
class Conversation:
|
|
19
|
+
|
|
20
|
+
messages: list[LLMMessage]
|
|
21
|
+
provider: LLMProvider
|
|
22
|
+
id: str | None = None
|
|
23
|
+
|
|
24
|
+
@classmethod
|
|
25
|
+
def create(
|
|
26
|
+
cls,
|
|
27
|
+
provider: LLMProvider,
|
|
28
|
+
model_prompt: str = TRILOGY_LEAD_IN,
|
|
29
|
+
id: str | None = None,
|
|
30
|
+
) -> "Conversation":
|
|
31
|
+
system_message = LLMMessage(role="system", content=model_prompt)
|
|
32
|
+
messages = [system_message]
|
|
33
|
+
return cls(id=id, messages=messages, provider=provider)
|
|
34
|
+
|
|
35
|
+
def add_message(
|
|
36
|
+
self,
|
|
37
|
+
message: Union[LLMMessage, str],
|
|
38
|
+
role: Literal["user", "assistant"] = "user",
|
|
39
|
+
) -> None:
|
|
40
|
+
"""
|
|
41
|
+
Add a message to the conversation.
|
|
42
|
+
|
|
43
|
+
Args:
|
|
44
|
+
message: Either an LLMMessage object or a string content
|
|
45
|
+
role: The role for the message if a string is provided (default: 'user')
|
|
46
|
+
"""
|
|
47
|
+
if isinstance(message, str):
|
|
48
|
+
message = LLMMessage(role=role, content=message)
|
|
49
|
+
self.messages.append(message)
|
|
50
|
+
|
|
51
|
+
def get_response(self) -> LLMMessage:
|
|
52
|
+
options = LLMRequestOptions()
|
|
53
|
+
response = self.provider.generate_completion(options, history=self.messages)
|
|
54
|
+
response_message = LLMMessage(role="assistant", content=response.text)
|
|
55
|
+
self.add_message(response_message)
|
|
56
|
+
return response_message
|
|
57
|
+
|
|
58
|
+
def extract_response(self, content: str) -> str:
|
|
59
|
+
# get contents in triple backticks
|
|
60
|
+
content = content.replace('"""', "```")
|
|
61
|
+
# replace markdown trilogy code block prefix that is
|
|
62
|
+
# sometimes added
|
|
63
|
+
content = content.replace("```trilogy", "```")
|
|
64
|
+
if "```" in content:
|
|
65
|
+
parts = content.split("```")
|
|
66
|
+
if len(parts) >= 3:
|
|
67
|
+
return parts[-2].strip()
|
|
68
|
+
return content
|
|
69
|
+
|
|
70
|
+
def generate_query(
|
|
71
|
+
self, user_input: str, environment: Environment, attempts: int = 4
|
|
72
|
+
) -> str:
|
|
73
|
+
attempts = 0
|
|
74
|
+
self.add_message(create_query_prompt(user_input, environment), role="user")
|
|
75
|
+
e = None
|
|
76
|
+
while attempts < 4:
|
|
77
|
+
attempts += 1
|
|
78
|
+
|
|
79
|
+
response_message = self.get_response()
|
|
80
|
+
response = self.extract_response(response_message.content)
|
|
81
|
+
if not response.strip():
|
|
82
|
+
self.add_message(
|
|
83
|
+
"Your response did not contain a valid Trilogy query. Please provide a valid Trilogy query enclosed in triple backticks, without a language specification.",
|
|
84
|
+
role="user",
|
|
85
|
+
)
|
|
86
|
+
continue
|
|
87
|
+
if not response.strip()[-1] == ";":
|
|
88
|
+
response += ";"
|
|
89
|
+
try:
|
|
90
|
+
_, raw = environment.parse(response)
|
|
91
|
+
process_query(statement=raw[-1], environment=environment)
|
|
92
|
+
return response
|
|
93
|
+
except (
|
|
94
|
+
InvalidSyntaxException,
|
|
95
|
+
NoDatasourceException,
|
|
96
|
+
UnresolvableQueryException,
|
|
97
|
+
UndefinedConceptException,
|
|
98
|
+
SyntaxError,
|
|
99
|
+
) as e2:
|
|
100
|
+
e = e2
|
|
101
|
+
self.add_message(
|
|
102
|
+
f"Your extracted response - {response} - could not be parsed due to the error: {str(e)}. Please generate a new query with the issues fixed. Use the same response format.",
|
|
103
|
+
role="user",
|
|
104
|
+
)
|
|
105
|
+
raise Exception(
|
|
106
|
+
f"Failed to generate a valid query after {attempts} attempts. Last error: {str(e)}. Full conversation: {self.messages}"
|
|
107
|
+
)
|
trilogy/ai/enums.py
ADDED
trilogy/ai/execute.py
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
from trilogy import Environment
|
|
2
|
+
from trilogy.ai.conversation import Conversation
|
|
3
|
+
from trilogy.ai.enums import Provider
|
|
4
|
+
from trilogy.ai.providers.base import LLMProvider
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def text_to_query(
|
|
8
|
+
environment: Environment,
|
|
9
|
+
user_input: str,
|
|
10
|
+
provider: Provider,
|
|
11
|
+
model: str,
|
|
12
|
+
secret: str | None = None,
|
|
13
|
+
) -> str:
|
|
14
|
+
llm_provider: LLMProvider
|
|
15
|
+
|
|
16
|
+
if provider == Provider.OPENAI:
|
|
17
|
+
from trilogy.ai.providers.openai import OpenAIProvider
|
|
18
|
+
|
|
19
|
+
llm_provider = OpenAIProvider(
|
|
20
|
+
name="openai",
|
|
21
|
+
api_key=secret,
|
|
22
|
+
model=model,
|
|
23
|
+
)
|
|
24
|
+
elif provider == Provider.ANTHROPIC:
|
|
25
|
+
from trilogy.ai.providers.anthropic import AnthropicProvider
|
|
26
|
+
|
|
27
|
+
llm_provider = AnthropicProvider(
|
|
28
|
+
name="anthropic",
|
|
29
|
+
api_key=secret,
|
|
30
|
+
model=model,
|
|
31
|
+
)
|
|
32
|
+
elif provider == Provider.GOOGLE:
|
|
33
|
+
from trilogy.ai.providers.google import GoogleProvider
|
|
34
|
+
|
|
35
|
+
llm_provider = GoogleProvider(
|
|
36
|
+
name="google",
|
|
37
|
+
api_key=secret,
|
|
38
|
+
model=model,
|
|
39
|
+
)
|
|
40
|
+
else:
|
|
41
|
+
raise ValueError(f"Unsupported provider: {provider}")
|
|
42
|
+
conversation = Conversation.create(
|
|
43
|
+
provider=llm_provider,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
response = conversation.generate_query(
|
|
47
|
+
user_input=user_input, environment=environment
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
return response
|
trilogy/ai/models.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from typing import Literal, Optional
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
@dataclass
|
|
6
|
+
class UsageDict:
|
|
7
|
+
prompt_tokens: int
|
|
8
|
+
completion_tokens: int
|
|
9
|
+
total_tokens: int
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@dataclass
|
|
13
|
+
class LLMResponse:
|
|
14
|
+
text: str
|
|
15
|
+
usage: UsageDict
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@dataclass
|
|
19
|
+
class LLMRequestOptions:
|
|
20
|
+
max_tokens: Optional[int] = None
|
|
21
|
+
temperature: Optional[float] = None
|
|
22
|
+
top_p: Optional[float] = None
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@dataclass
|
|
26
|
+
class LLMMessage:
|
|
27
|
+
role: Literal["user", "assistant", "system"]
|
|
28
|
+
content: str
|
|
29
|
+
model_info: Optional[dict] = None
|
|
30
|
+
hidden: bool = False # Used to hide messages in the UI
|
|
31
|
+
|
|
32
|
+
def __post_init__(self):
|
|
33
|
+
if self.model_info is None:
|
|
34
|
+
self.model_info = {}
|