From 1eb092d9ce9ca2a801c6d2bc045eb048686bb74c Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 24 Oct 2024 22:17:06 +0000 Subject: [PATCH] Update query snapshots --- .../test/__snapshots__/test_resolver.ambr | 1477 +++++------------ 1 file changed, 397 insertions(+), 1080 deletions(-) diff --git a/posthog/hogql/test/__snapshots__/test_resolver.ambr b/posthog/hogql/test/__snapshots__/test_resolver.ambr index d38d909cc43e7..f0ae317ac0843 100644 --- a/posthog/hogql/test/__snapshots__/test_resolver.ambr +++ b/posthog/hogql/test/__snapshots__/test_resolver.ambr @@ -2065,933 +2065,360 @@ ] select_from: { table: { - select_queries: [ + select: [ { - select: [ - { - alias: "uuid" - expr: { - chain: [ - "uuid" - ] - type: - } - hidden: True - type: - }, - { - alias: "event" - expr: { - chain: [ - "event" - ] - type: - } - hidden: True - type: - }, - { - alias: "properties" - expr: { - chain: [ - "properties" - ] - type: - } - hidden: True - type: - }, - { - alias: "timestamp" - expr: { - chain: [ - "timestamp" - ] - type: - } - hidden: True - type: - }, - { - alias: "distinct_id" - expr: { - chain: [ - "distinct_id" - ] - type: - } - hidden: True - type: - }, - { - alias: "elements_chain" - expr: { - chain: [ - "elements_chain" - ] - type: - } - hidden: True - type: - }, - { - alias: "created_at" - expr: { - chain: [ - "created_at" - ] - type: - } - hidden: True - type: - }, - { - alias: "$session_id" - expr: { - chain: [ - "$session_id" - ] - type: - } - hidden: True - type: - }, - { - alias: "$window_id" - expr: { - chain: [ - "$window_id" - ] - type: - } - hidden: True - type: - }, - { - alias: "person_id" - expr: { + alias: "uuid" + expr: { + chain: [ + "uuid" + ] + type: + } + hidden: True + type: + }, + { + alias: "event" + expr: { + chain: [ + "event" + ] + type: + } + hidden: True + type: + }, + { + alias: "properties" + expr: { + chain: [ + "properties" + ] + type: + } + hidden: True + type: + }, + { + alias: "timestamp" + expr: { + chain: [ + "timestamp" + ] + type: + } + hidden: True + type: + }, + { + alias: "distinct_id" + expr: { + chain: [ + "distinct_id" + ] + type: + } + hidden: True + type: + }, + { + alias: "elements_chain" + expr: { + chain: [ + "elements_chain" + ] + type: + } + hidden: True + type: + }, + { + alias: "created_at" + expr: { + chain: [ + "created_at" + ] + type: + } + hidden: True + type: + }, + { + alias: "$session_id" + expr: { + chain: [ + "$session_id" + ] + type: + } + hidden: True + type: + }, + { + alias: "$window_id" + expr: { + chain: [ + "$window_id" + ] + type: + } + hidden: True + type: + }, + { + alias: "person_id" + expr: { + args: [ + { args: [ { args: [ { - args: [ - { - alias: "distinct_id" - expr: { - chain: [ - "override", - "distinct_id" - ] - type: { - name: "distinct_id" - table_type: { - field: "override" - lazy_join: { - from_field: [ - "distinct_id" - ], - join_function: , - join_table: { - fields: { - distinct_id: {}, - person: {}, - person_id: {}, - team_id: {} - } - }, - to_field: None + alias: "distinct_id" + expr: { + chain: [ + "override", + "distinct_id" + ] + type: { + name: "distinct_id" + table_type: { + field: "override" + lazy_join: { + from_field: [ + "distinct_id" + ], + join_function: , + join_table: { + fields: { + distinct_id: {}, + person: {}, + person_id: {}, + team_id: {} } - table_type: - } + }, + to_field: None } - } - hidden: True - type: { - alias: "distinct_id" - type: + table_type: } } - ] - distinct: False - name: "empty" + } + hidden: True type: { - arg_types: [ - { - data_type: "str" - nullable: False - } - ] - name: "empty" - return_type: { - data_type: "unknown" - nullable: True - } + alias: "distinct_id" + type: } } ] distinct: False - name: "not" + name: "empty" type: { arg_types: [ - - ] - name: "not" - return_type: - } - }, - { - alias: "person_id" - expr: { - chain: [ - "override", - "person_id" - ] - type: { - name: "person_id" - table_type: { - field: "override" - lazy_join: { - from_field: [ - "distinct_id" - ], - join_function: , - join_table: { - fields: { - distinct_id: {}, - person: {}, - person_id: {}, - team_id: {} - } - }, - to_field: None - } - table_type: + { + data_type: "str" + nullable: False } - } - } - hidden: True - type: { - alias: "person_id" - type: - } - }, - { - alias: "event_person_id" - expr: { - chain: [ - "event_person_id" ] - type: { - name: "event_person_id" - table_type: + name: "empty" + return_type: { + data_type: "unknown" + nullable: True } } - hidden: True - type: { - alias: "event_person_id" - type: - } } ] distinct: False - name: "if" - type: - } - hidden: True - type: - }, - { - alias: "$group_0" - expr: { - chain: [ - "$group_0" - ] - type: - } - hidden: True - type: - }, - { - alias: "$group_1" - expr: { - chain: [ - "$group_1" - ] - type: - } - hidden: True - type: - }, - { - alias: "$group_2" - expr: { - chain: [ - "$group_2" - ] - type: - } - hidden: True - type: - }, - { - alias: "$group_3" - expr: { - chain: [ - "$group_3" - ] - type: - } - hidden: True - type: - }, - { - alias: "$group_4" - expr: { - chain: [ - "$group_4" - ] - type: - } - hidden: True - type: - }, - { - alias: "elements_chain_href" - expr: { - chain: [ - "elements_chain_href" - ] - type: - } - hidden: True - type: - }, - { - alias: "elements_chain_texts" - expr: { - chain: [ - "elements_chain_texts" - ] - type: - } - hidden: True - type: - }, - { - alias: "elements_chain_ids" - expr: { - chain: [ - "elements_chain_ids" - ] - type: - } - hidden: True - type: - }, - { - alias: "elements_chain_elements" - expr: { - chain: [ - "elements_chain_elements" - ] - type: - } - hidden: True - type: - }, - { - alias: "event_person_id" - expr: { - chain: [ - "event_person_id" - ] - type: - } - hidden: True - type: - } - ] - select_from: { - table: { - chain: [ - "events" - ] - type: - } - type: - } - type: - }, - { - select: [ - { - alias: "uuid" - expr: { - chain: [ - "uuid" - ] - type: { - name: "uuid" - table_type: { - table: { - fields: { - $group_0: {}, - $group_1: {}, - $group_2: {}, - $group_3: {}, - $group_4: {}, - $session_id: {}, - $window_id: {}, - created_at: {}, - distinct_id: {}, - elements_chain: {}, - elements_chain_elements: {}, - elements_chain_href: {}, - elements_chain_ids: {}, - elements_chain_texts: {}, - event: {}, - event_person_id: {}, - goe_0: {}, - goe_1: {}, - goe_2: {}, - goe_3: {}, - goe_4: {}, - group_0: {}, - group_1: {}, - group_2: {}, - group_3: {}, - group_4: {}, - override: {}, - pdi: {}, - person: {}, - person_id: {}, - poe: {}, - properties: {}, - session: {}, - team_id: {}, - timestamp: {}, - uuid: {} - } - } - } - } - } - hidden: True - type: { - alias: "uuid" - type: - } - }, - { - alias: "event" - expr: { - chain: [ - "event" - ] - type: { - name: "event" - table_type: - } - } - hidden: True - type: { - alias: "event" - type: - } - }, - { - alias: "properties" - expr: { - chain: [ - "properties" - ] - type: { - name: "properties" - table_type: - } - } - hidden: True - type: { - alias: "properties" - type: - } - }, - { - alias: "timestamp" - expr: { - chain: [ - "timestamp" - ] - type: { - name: "timestamp" - table_type: - } - } - hidden: True - type: { - alias: "timestamp" - type: - } - }, - { - alias: "distinct_id" - expr: { - chain: [ - "distinct_id" - ] - type: { - name: "distinct_id" - table_type: - } - } - hidden: True - type: { - alias: "distinct_id" - type: - } - }, - { - alias: "elements_chain" - expr: { - chain: [ - "elements_chain" - ] - type: { - name: "elements_chain" - table_type: - } - } - hidden: True - type: { - alias: "elements_chain" - type: - } - }, - { - alias: "created_at" - expr: { - chain: [ - "created_at" - ] - type: { - name: "created_at" - table_type: - } - } - hidden: True - type: { - alias: "created_at" - type: - } - }, - { - alias: "$session_id" - expr: { - chain: [ - "$session_id" - ] - type: { - name: "$session_id" - table_type: - } - } - hidden: True - type: { - alias: "$session_id" - type: - } - }, - { - alias: "$window_id" - expr: { - chain: [ - "$window_id" - ] - type: { - name: "$window_id" - table_type: - } - } - hidden: True - type: { - alias: "$window_id" - type: - } - }, - { - alias: "person_id" - expr: { - args: [ - { - args: [ - { - args: [ - { - alias: "distinct_id" - expr: { - chain: [ - "override", - "distinct_id" - ] - type: { - name: "distinct_id" - table_type: { - field: "override" - lazy_join: { - from_field: [ - "distinct_id" - ], - join_function: , - join_table: { - fields: { - distinct_id: {}, - person: {}, - person_id: {}, - team_id: {} - } - }, - to_field: None - } - table_type: - } - } - } - hidden: True - type: { - alias: "distinct_id" - type: - } - } - ] - distinct: False - name: "empty" - type: { - arg_types: [ - { - data_type: "str" - nullable: False - } - ] - name: "empty" - return_type: { - data_type: "unknown" - nullable: True - } - } - } - ] - distinct: False - name: "not" - type: { - arg_types: [ - - ] - name: "not" - return_type: { - data_type: "unknown" - nullable: True - } - } - }, - { - alias: "person_id" - expr: { - chain: [ - "override", - "person_id" - ] - type: { - name: "person_id" - table_type: { - field: "override" - lazy_join: { - from_field: [ - "distinct_id" - ], - join_function: , - join_table: { - fields: { - distinct_id: {}, - person: {}, - person_id: {}, - team_id: {} - } - }, - to_field: None - } - table_type: - } - } - } - hidden: True - type: { - alias: "person_id" - type: - } - }, - { - alias: "event_person_id" - expr: { - chain: [ - "event_person_id" - ] - type: { - name: "event_person_id" - table_type: - } - } - hidden: True - type: { - alias: "event_person_id" - type: - } - } - ] - distinct: False - name: "if" - type: { - arg_types: [ - , - { - data_type: "str" - nullable: False - }, - { - data_type: "str" - nullable: False - } - ] - name: "if" - return_type: { - data_type: "unknown" - nullable: True - } - } - } - hidden: True - type: { - alias: "person_id" - type: - } - }, - { - alias: "$group_0" - expr: { - chain: [ - "$group_0" - ] - type: { - name: "$group_0" - table_type: - } - } - hidden: True - type: { - alias: "$group_0" - type: - } - }, - { - alias: "$group_1" - expr: { - chain: [ - "$group_1" - ] - type: { - name: "$group_1" - table_type: - } - } - hidden: True - type: { - alias: "$group_1" - type: - } - }, - { - alias: "$group_2" - expr: { - chain: [ - "$group_2" - ] - type: { - name: "$group_2" - table_type: - } - } - hidden: True - type: { - alias: "$group_2" - type: - } - }, - { - alias: "$group_3" - expr: { - chain: [ - "$group_3" - ] - type: { - name: "$group_3" - table_type: - } - } - hidden: True - type: { - alias: "$group_3" - type: - } - }, - { - alias: "$group_4" - expr: { - chain: [ - "$group_4" - ] - type: { - name: "$group_4" - table_type: - } - } - hidden: True - type: { - alias: "$group_4" - type: - } - }, - { - alias: "elements_chain_href" - expr: { - chain: [ - "elements_chain_href" - ] + name: "not" type: { - name: "elements_chain_href" - table_type: + arg_types: [ + + ] + name: "not" + return_type: } - } - hidden: True - type: { - alias: "elements_chain_href" - type: - } - }, - { - alias: "elements_chain_texts" - expr: { - chain: [ - "elements_chain_texts" - ] - type: { - name: "elements_chain_texts" - table_type: + }, + { + alias: "person_id" + expr: { + chain: [ + "override", + "person_id" + ] + type: { + name: "person_id" + table_type: { + field: "override" + lazy_join: { + from_field: [ + "distinct_id" + ], + join_function: , + join_table: { + fields: { + distinct_id: {}, + person: {}, + person_id: {}, + team_id: {} + } + }, + to_field: None + } + table_type: + } + } } - } - hidden: True - type: { - alias: "elements_chain_texts" - type: - } - }, - { - alias: "elements_chain_ids" - expr: { - chain: [ - "elements_chain_ids" - ] + hidden: True type: { - name: "elements_chain_ids" - table_type: + alias: "person_id" + type: } - } - hidden: True - type: { - alias: "elements_chain_ids" - type: - } - }, - { - alias: "elements_chain_elements" - expr: { - chain: [ - "elements_chain_elements" - ] - type: { - name: "elements_chain_elements" - table_type: + }, + { + alias: "event_person_id" + expr: { + chain: [ + "event_person_id" + ] + type: { + name: "event_person_id" + table_type: + } } - } - hidden: True - type: { - alias: "elements_chain_elements" - type: - } - }, - { - alias: "event_person_id" - expr: { - chain: [ - "event_person_id" - ] + hidden: True type: { - name: "event_person_id" - table_type: + alias: "event_person_id" + type: } } - hidden: True - type: { - alias: "event_person_id" - type: - } - } - ] - select_from: { - table: { - chain: [ - "events" - ] - type: - } + ] + distinct: False + name: "if" type: } - type: { - aliases: {} - anonymous_tables: [] - columns: { - $group_0: , - $group_1: , - $group_2: , - $group_3: , - $group_4: , - $session_id: , - $window_id: , - created_at: , - distinct_id: , - elements_chain: , - elements_chain_elements: , - elements_chain_href: , - elements_chain_ids: , - elements_chain_texts: , - event: , - event_person_id: , - person_id: , - properties: , - timestamp: , - uuid: - } - ctes: {} - tables: { - events: - } + hidden: True + type: + }, + { + alias: "$group_0" + expr: { + chain: [ + "$group_0" + ] + type: + } + hidden: True + type: + }, + { + alias: "$group_1" + expr: { + chain: [ + "$group_1" + ] + type: + } + hidden: True + type: + }, + { + alias: "$group_2" + expr: { + chain: [ + "$group_2" + ] + type: + } + hidden: True + type: + }, + { + alias: "$group_3" + expr: { + chain: [ + "$group_3" + ] + type: + } + hidden: True + type: + }, + { + alias: "$group_4" + expr: { + chain: [ + "$group_4" + ] + type: + } + hidden: True + type: + }, + { + alias: "elements_chain_href" + expr: { + chain: [ + "elements_chain_href" + ] + type: + } + hidden: True + type: + }, + { + alias: "elements_chain_texts" + expr: { + chain: [ + "elements_chain_texts" + ] + type: + } + hidden: True + type: + }, + { + alias: "elements_chain_ids" + expr: { + chain: [ + "elements_chain_ids" + ] + type: + } + hidden: True + type: + }, + { + alias: "elements_chain_elements" + expr: { + chain: [ + "elements_chain_elements" + ] + type: + } + hidden: True + type: + }, + { + alias: "event_person_id" + expr: { + chain: [ + "event_person_id" + ] + type: } + hidden: True + type: + } + ] + select_from: { + table: { + chain: [ + "events" + ] + type: } - ] - type: { - types: [ - , - - ] + type: } + type: } type: } @@ -6128,213 +5555,103 @@ # name: TestResolver.test_resolve_union_all ''' { - select_queries: [ + select: [ { - select: [ - { - alias: "event" - expr: { - chain: [ - "event" - ] - type: { - name: "event" - table_type: { - table: { - fields: { - $group_0: {}, - $group_1: {}, - $group_2: {}, - $group_3: {}, - $group_4: {}, - $session_id: {}, - $window_id: {}, - created_at: {}, - distinct_id: {}, - elements_chain: {}, - elements_chain_elements: {}, - elements_chain_href: {}, - elements_chain_ids: {}, - elements_chain_texts: {}, - event: {}, - event_person_id: {}, - goe_0: {}, - goe_1: {}, - goe_2: {}, - goe_3: {}, - goe_4: {}, - group_0: {}, - group_1: {}, - group_2: {}, - group_3: {}, - group_4: {}, - override: {}, - pdi: {}, - person: {}, - person_id: {}, - poe: {}, - properties: {}, - session: {}, - team_id: {}, - timestamp: {}, - uuid: {} - } - } + alias: "event" + expr: { + chain: [ + "event" + ] + type: { + name: "event" + table_type: { + table: { + fields: { + $group_0: {}, + $group_1: {}, + $group_2: {}, + $group_3: {}, + $group_4: {}, + $session_id: {}, + $window_id: {}, + created_at: {}, + distinct_id: {}, + elements_chain: {}, + elements_chain_elements: {}, + elements_chain_href: {}, + elements_chain_ids: {}, + elements_chain_texts: {}, + event: {}, + event_person_id: {}, + goe_0: {}, + goe_1: {}, + goe_2: {}, + goe_3: {}, + goe_4: {}, + group_0: {}, + group_1: {}, + group_2: {}, + group_3: {}, + group_4: {}, + override: {}, + pdi: {}, + person: {}, + person_id: {}, + poe: {}, + properties: {}, + session: {}, + team_id: {}, + timestamp: {}, + uuid: {} } } } - hidden: True - type: { - alias: "event" - type: - } - }, - { - alias: "timestamp" - expr: { - chain: [ - "timestamp" - ] - type: { - name: "timestamp" - table_type: - } - } - hidden: True - type: { - alias: "timestamp" - type: - } - } - ] - select_from: { - table: { - chain: [ - "events" - ] - type: } - type: } + hidden: True type: { - aliases: {} - anonymous_tables: [] - columns: { - event: , - timestamp: - } - ctes: {} - tables: { - events: - } + alias: "event" + type: } }, { - select: [ - { - alias: "event" - expr: { - chain: [ - "event" - ] - type: { - name: "event" - table_type: { - table: { - fields: { - $group_0: {}, - $group_1: {}, - $group_2: {}, - $group_3: {}, - $group_4: {}, - $session_id: {}, - $window_id: {}, - created_at: {}, - distinct_id: {}, - elements_chain: {}, - elements_chain_elements: {}, - elements_chain_href: {}, - elements_chain_ids: {}, - elements_chain_texts: {}, - event: {}, - event_person_id: {}, - goe_0: {}, - goe_1: {}, - goe_2: {}, - goe_3: {}, - goe_4: {}, - group_0: {}, - group_1: {}, - group_2: {}, - group_3: {}, - group_4: {}, - override: {}, - pdi: {}, - person: {}, - person_id: {}, - poe: {}, - properties: {}, - session: {}, - team_id: {}, - timestamp: {}, - uuid: {} - } - } - } - } - } - hidden: True - type: { - alias: "event" - type: - } - }, - { - alias: "timestamp" - expr: { - chain: [ - "timestamp" - ] - type: { - name: "timestamp" - table_type: - } - } - hidden: True - type: { - alias: "timestamp" - type: - } - } - ] - select_from: { - table: { - chain: [ - "events" - ] - type: + alias: "timestamp" + expr: { + chain: [ + "timestamp" + ] + type: { + name: "timestamp" + table_type: } - type: } + hidden: True type: { - aliases: {} - anonymous_tables: [] - columns: { - event: , - timestamp: - } - ctes: {} - tables: { - events: - } + alias: "timestamp" + type: } } ] + select_from: { + table: { + chain: [ + "events" + ] + type: + } + type: + } type: { - types: [ - , - - ] + aliases: {} + anonymous_tables: [] + columns: { + event: , + timestamp: + } + ctes: {} + tables: { + events: + } } } '''