pytrilogy 0.0.3.120__tar.gz → 0.0.3.121__tar.gz
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.120/pytrilogy.egg-info → pytrilogy-0.0.3.121}/PKG-INFO +1 -1
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121/pytrilogy.egg-info}/PKG-INFO +1 -1
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/tests/test_user_functions.py +35 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/__init__.py +1 -1
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/models/author.py +4 -9
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/dialect/duckdb.py +1 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/parsing/parse_engine.py +1 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/LICENSE.md +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/README.md +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/pyproject.toml +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/pytrilogy.egg-info/SOURCES.txt +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/pytrilogy.egg-info/dependency_links.txt +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/pytrilogy.egg-info/entry_points.txt +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/pytrilogy.egg-info/requires.txt +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/pytrilogy.egg-info/top_level.txt +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/requirements.txt +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/setup.cfg +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/tests/test_datatypes.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/tests/test_declarations.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/tests/test_derived_concepts.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/tests/test_discovery_nodes.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/tests/test_enums.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/tests/test_environment.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/tests/test_execute_models.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/tests/test_executor.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/tests/test_failure.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/tests/test_functions.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/tests/test_imports.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/tests/test_metadata.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/tests/test_models.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/tests/test_multi_join_assignments.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/tests/test_parse_engine.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/tests/test_parsing.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/tests/test_parsing_failures.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/tests/test_partial_handling.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/tests/test_query_processing.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/tests/test_query_render.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/tests/test_select.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/tests/test_show.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/tests/test_statements.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/tests/test_typing.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/tests/test_undefined_concept.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/tests/test_validators.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/tests/test_where_clause.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/ai/__init__.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/ai/constants.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/ai/conversation.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/ai/enums.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/ai/execute.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/ai/models.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/ai/prompts.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/ai/providers/__init__.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/ai/providers/anthropic.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/ai/providers/base.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/ai/providers/google.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/ai/providers/openai.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/ai/providers/utils.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/authoring/__init__.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/constants.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/__init__.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/constants.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/enums.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/env_processor.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/environment_helpers.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/ergonomics.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/exceptions.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/functions.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/graph_models.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/internal.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/models/__init__.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/models/build.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/models/build_environment.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/models/core.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/models/datasource.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/models/environment.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/models/execute.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/optimization.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/optimizations/__init__.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/optimizations/base_optimization.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/optimizations/hide_unused_concept.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/optimizations/inline_datasource.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/optimizations/predicate_pushdown.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/__init__.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/concept_strategies_v3.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/discovery_node_factory.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/discovery_utility.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/discovery_validation.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/graph_utils.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/__init__.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/basic_node.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/common.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/constant_node.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/filter_node.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/group_node.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/group_to_node.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/multiselect_node.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/node_merge_node.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/recursive_node.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/rowset_node.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/select_helpers/__init__.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/select_helpers/datasource_injection.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/select_merge_node.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/select_node.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/synonym_node.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/union_node.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/unnest_node.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/window_node.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/nodes/__init__.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/nodes/base_node.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/nodes/filter_node.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/nodes/group_node.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/nodes/merge_node.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/nodes/recursive_node.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/nodes/select_node_v2.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/nodes/union_node.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/nodes/unnest_node.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/nodes/window_node.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/utility.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/query_processor.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/statements/__init__.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/statements/author.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/statements/build.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/statements/common.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/statements/execute.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/utility.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/validation/__init__.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/validation/common.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/validation/concept.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/validation/datasource.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/validation/environment.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/validation/fix.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/dialect/__init__.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/dialect/base.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/dialect/bigquery.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/dialect/common.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/dialect/config.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/dialect/dataframe.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/dialect/enums.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/dialect/metadata.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/dialect/postgres.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/dialect/presto.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/dialect/snowflake.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/dialect/sql_server.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/engine.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/executor.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/hooks/__init__.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/hooks/base_hook.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/hooks/graph_hook.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/hooks/query_debugger.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/metadata/__init__.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/parser.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/parsing/__init__.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/parsing/common.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/parsing/config.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/parsing/exceptions.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/parsing/helpers.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/parsing/render.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/parsing/trilogy.lark +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/py.typed +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/render.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/scripts/__init__.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/scripts/trilogy.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/std/__init__.py +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/std/color.preql +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/std/date.preql +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/std/display.preql +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/std/geography.preql +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/std/metric.preql +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/std/money.preql +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/std/net.preql +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/std/ranking.preql +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/std/report.preql +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/std/semantic.preql +0 -0
- {pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/utility.py +0 -0
|
@@ -312,3 +312,38 @@ auto random <- @plus_two(@weekday_sales(10));
|
|
|
312
312
|
results = results.fetchall()
|
|
313
313
|
assert results[0].test2 == 10
|
|
314
314
|
assert results[1].test2 == 17
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
def test_user_function_aggregate_two():
|
|
318
|
+
x = Dialects.DUCK_DB.default_executor()
|
|
319
|
+
|
|
320
|
+
results = x.execute_query(
|
|
321
|
+
"""import std.geography;
|
|
322
|
+
import std.display;
|
|
323
|
+
|
|
324
|
+
key state string::us_state;
|
|
325
|
+
key year int;
|
|
326
|
+
property state.val string;
|
|
327
|
+
|
|
328
|
+
datasource states
|
|
329
|
+
(
|
|
330
|
+
state,
|
|
331
|
+
year,
|
|
332
|
+
val
|
|
333
|
+
)
|
|
334
|
+
grain (state, year)
|
|
335
|
+
query '''
|
|
336
|
+
select 'Vermont' as state, 2000 as year, 10 as val union all select 'Florida' as state, 2000, 5 as val
|
|
337
|
+
union all select 'Vermont', 2001, 16 union all select 'Florida' as state, 2001, 7
|
|
338
|
+
'''
|
|
339
|
+
;
|
|
340
|
+
|
|
341
|
+
def avg_year_percent_of_all_avg_year(field, dim)->round((avg(sum(field) by year, dim)/ avg(sum(field) by year )),2)::float::percent;
|
|
342
|
+
|
|
343
|
+
select @avg_year_percent_of_all_avg_year(val, state) as p_of_whole, state
|
|
344
|
+
order by p_of_whole desc;
|
|
345
|
+
"""
|
|
346
|
+
)
|
|
347
|
+
|
|
348
|
+
results = results.fetchall()
|
|
349
|
+
assert int(results[0].p_of_whole * 100) == 68
|
|
@@ -162,14 +162,13 @@ class ConceptRef(Addressable, Namespaced, DataTyped, Mergeable, BaseModel):
|
|
|
162
162
|
)
|
|
163
163
|
|
|
164
164
|
def with_reference_replacement(self, source: str, target: Expr | ArgBinding):
|
|
165
|
-
if self.address == source:
|
|
166
|
-
return target
|
|
167
|
-
|
|
168
165
|
# a reference might be to an attribute of a struct that is bound late
|
|
169
166
|
# if the replacement is a parent in the access path; replace reference
|
|
170
167
|
# with an attribute access call
|
|
171
|
-
candidates = [f"
|
|
168
|
+
candidates = [f"{DEFAULT_NAMESPACE}.{self.address}", self.address]
|
|
172
169
|
for candidate in candidates:
|
|
170
|
+
if candidate == source:
|
|
171
|
+
return target
|
|
173
172
|
if not candidate.startswith(f"{source}."):
|
|
174
173
|
continue
|
|
175
174
|
attribute = self.address.rsplit(".", 1)[1]
|
|
@@ -2535,11 +2534,7 @@ class CustomFunctionFactory:
|
|
|
2535
2534
|
target = f"{DEFAULT_NAMESPACE}.{self.function_arguments[idx].name}"
|
|
2536
2535
|
else:
|
|
2537
2536
|
target = self.function_arguments[idx].name
|
|
2538
|
-
nout = (
|
|
2539
|
-
nout.with_reference_replacement(target, x)
|
|
2540
|
-
if isinstance(nout, Mergeable)
|
|
2541
|
-
else nout
|
|
2542
|
-
)
|
|
2537
|
+
nout = nout.with_reference_replacement(target, x)
|
|
2543
2538
|
return nout
|
|
2544
2539
|
|
|
2545
2540
|
|
|
@@ -104,6 +104,7 @@ FUNCTION_MAP = {
|
|
|
104
104
|
FunctionType.CONCAT: lambda x: f"({' || '.join(x)})",
|
|
105
105
|
FunctionType.DATE_LITERAL: lambda x: f"date '{x}'",
|
|
106
106
|
FunctionType.DATETIME_LITERAL: lambda x: f"datetime '{x}'",
|
|
107
|
+
FunctionType.DAY_OF_WEEK: lambda x: f"dayofweek({x[0]})",
|
|
107
108
|
# string
|
|
108
109
|
FunctionType.CONTAINS: lambda x: f"CONTAINS(LOWER({x[0]}), LOWER({x[1]}))",
|
|
109
110
|
# regexp
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/optimizations/hide_unused_concept.py
RENAMED
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/optimizations/predicate_pushdown.py
RENAMED
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/concept_strategies_v3.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/discovery_node_factory.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/__init__.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/basic_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/common.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/constant_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/filter_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/group_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/group_to_node.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/rowset_node.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/select_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/synonym_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/union_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/unnest_node.py
RENAMED
|
File without changes
|
{pytrilogy-0.0.3.120 → pytrilogy-0.0.3.121}/trilogy/core/processing/node_generators/window_node.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|