Skip to content

Commit 63c9172

Browse files
committed
updated snapshots
1 parent 4bf7426 commit 63c9172

File tree

1 file changed

+294
-0
lines changed

1 file changed

+294
-0
lines changed
Lines changed: 294 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,294 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`Jinja (new api) render 01.yml.jinja: 01.yml.jinja 1`] = `
4+
"cubes:
5+
- name: cube_01_1
6+
sql: >
7+
SELECT
8+
order_id,
9+
SUM(CASE WHEN payment_method = 'TRANSFER' THEN amount END) AS bank_transfer_amount,
10+
SUM(CASE WHEN payment_method = 'CREDIT' THEN amount END) AS credit_card_amount,
11+
SUM(CASE WHEN payment_method = 'GIFT' THEN amount END) AS gift_card_amount,
12+
SUM(amount) AS total_amount
13+
FROM app_data.payments
14+
GROUP BY 1
15+
16+
- name: cube_01_2
17+
sql: >
18+
SELECT
19+
order_id,
20+
SUM(CASE WHEN payment_method = 'TRANSFER' THEN amount END) AS bank_transfer_amount,
21+
SUM(CASE WHEN payment_method = 'CREDIT' THEN amount END) AS credit_card_amount,
22+
SUM(CASE WHEN payment_method = 'GIFT' THEN amount END) AS gift_card_amount
23+
FROM app_data.payments
24+
GROUP BY 1"
25+
`;
26+
27+
exports[`Jinja (new api) render 02.yml.jinja: 02.yml.jinja 1`] = `
28+
"cubes:
29+
- name: cube_02
30+
sql: >
31+
SELECT
32+
referrer_prop.value AS referrer
33+
href_prop.value AS href
34+
host_prop.value AS host
35+
pathname_prop.value AS pathname
36+
search_prop.value AS search
37+
FROM public.events
38+
LEFT JOIN UNNEST(properties) AS referrer_prop ON referrer_prop.key = 'referrer'
39+
LEFT JOIN UNNEST(properties) AS href_prop ON href_prop.key = 'href'
40+
LEFT JOIN UNNEST(properties) AS host_prop ON host_prop.key = 'host'
41+
LEFT JOIN UNNEST(properties) AS pathname_prop ON pathname_prop.key = 'pathname'
42+
LEFT JOIN UNNEST(properties) AS search_prop ON search_prop.key = 'search'"
43+
`;
44+
45+
exports[`Jinja (new api) render 03.yml.jinja: 03.yml.jinja 1`] = `
46+
"
47+
48+
cubes:
49+
- name: cube_03
50+
sql: >
51+
SELECT
52+
*,
53+
'au' as country
54+
FROM au_orders
55+
56+
UNION ALL
57+
58+
SELECT
59+
*,
60+
'us' as country
61+
FROM us_orders
62+
"
63+
`;
64+
65+
exports[`Jinja (new api) render 04.yml.jinja: 04.yml.jinja 1`] = `
66+
"
67+
68+
cubes:
69+
- name: cube_04_\\"base_events\\"
70+
sql: >
71+
SELECT *
72+
FROM public.events
73+
WHERE
74+
{FILTER_PARAMS.cube_04_base_events.timestamp.filter('timestamp')} AND
75+
{FILTER_PARAMS.cube_04_product_purchases.timestamp.filter('timestamp')} AND
76+
{FILTER_PARAMS.cube_04_page_views.timestamp.filter('timestamp')}
77+
78+
dimensions:
79+
- name: timestamp
80+
sql: timestamp
81+
type: time
82+
83+
- name: cube_04_product_purchases
84+
extends: \\"base_events\\"
85+
sql_table: public.events
86+
87+
dimensions:
88+
- name: timestamp
89+
sql: timestamp
90+
type: time
91+
92+
- name: cube_04_page_views
93+
extends: \\"base_events\\"
94+
sql_table: public.events
95+
96+
dimensions:
97+
- name: timestamp
98+
sql: timestamp
99+
type: time
100+
"
101+
`;
102+
103+
exports[`Jinja (new api) render 05.yml.jinja: 05.yml.jinja 1`] = `
104+
"
105+
106+
cubes:
107+
- name: cube_05
108+
sql_table: public.orders
109+
110+
measures:
111+
- name: \\"day\\"
112+
type: count_distinct
113+
sql: user_id
114+
rolling_window:
115+
trailing: 1 day
116+
offset: start
117+
118+
- name: \\"mau\\"
119+
type: count_distinct
120+
sql: user_id
121+
rolling_window:
122+
trailing: 30 day
123+
offset: start
124+
125+
- name: \\"wau\\"
126+
type: count_distinct
127+
sql: user_id
128+
rolling_window:
129+
trailing: 7 day
130+
offset: start
131+
"
132+
`;
133+
134+
exports[`Jinja (new api) render 06.yml.jinja: 06.yml.jinja 1`] = `
135+
"cubes:
136+
- name: cube_06
137+
sql_table: public.orders
138+
139+
dimensions:
140+
- name: \\"id\\"
141+
sql: \\"id\\"
142+
type: \\"number\\"
143+
primary_key: true
144+
145+
- name: \\"status\\"
146+
sql: \\"status\\"
147+
type: \\"string\\"
148+
149+
- name: \\"created_at\\"
150+
sql: \\"created_at\\"
151+
type: \\"time\\"
152+
153+
- name: \\"completed_at\\"
154+
sql: \\"completed_at\\"
155+
type: \\"time\\"
156+
"
157+
`;
158+
159+
exports[`Jinja (new api) render 07.yml.jinja: 07.yml.jinja 1`] = `
160+
"cubes:
161+
- name: cube_07
162+
sql: >
163+
SELECT
164+
id AS payment_id,
165+
(\\"amount\\" / 100)::NUMERIC(16, 2) AS amount_usd,
166+
((\\"order_selling_price\\" - \\"order_cost_price\\") / \\"order_cost_price\\") AS markup
167+
FROM app_data.payments"
168+
`;
169+
170+
exports[`Jinja (new api) render 08.yml.jinja: 08.yml.jinja 1`] = `
171+
"{ cubes:
172+
- name: cube_08
173+
sql_table: public.orders
174+
data_source: \\"postgres\\" }"
175+
`;
176+
177+
exports[`Jinja (new api) render arguments-test.yml.jinja: arguments-test.yml.jinja 1`] = `
178+
"test:
179+
arg_sum_integers_int_int: 2
180+
arg_sum_integers_int_float: 4.140000000000001
181+
arg_bool_true: 1
182+
arg_bool_false: 0
183+
arg_str: \\"hello world\\"
184+
arg_null: null
185+
arg_seq_1: [1,2,3,4,5]
186+
arg_seq_2: [5,4,3,2,1]
187+
arg_sum_tuple: 3
188+
arg_sum_map: 20
189+
arg_kwargs1: \\"arg1: first value, arg2: second value, kwarg:(three=3 arg)\\"
190+
arg_kwargs2: \\"arg1: first value, arg2: second value, kwarg:(four=4 arg,three=3 arg)\\"
191+
arg_kwargs3: \\"arg1: first value, arg2: second value, kwarg:(five=5 arg,four=4 arg,three=3 arg)\\"
192+
arg_named_arguments1: \\"arg1: 1 arg, arg2: 2 arg\\"
193+
arg_named_arguments2: \\"arg1: 1 arg, arg2: 2 arg\\""
194+
`;
195+
196+
exports[`Jinja (new api) render data-model.yml.jinja: data-model.yml.jinja 1`] = `
197+
"cubes:
198+
199+
- name: \\"cube_from_api\\"
200+
measures:
201+
- name: \\"count\\"
202+
type: \\"count\\"
203+
- name: \\"total\\"
204+
type: \\"sum\\"
205+
sql: \\"amount\\"
206+
207+
- name: \\"cube_from_api_with_dimensions\\"
208+
measures:
209+
- name: \\"active_users\\"
210+
type: \\"count_distinct\\"
211+
sql: \\"user_id\\"
212+
dimensions:
213+
- name: \\"city\\"
214+
type: \\"string\\"
215+
sql: \\"city_column\\""
216+
`;
217+
218+
exports[`Jinja (new api) render dump_context.yml.jinja: dump_context.yml.jinja 1`] = `
219+
"
220+
<pre></pre>
221+
222+
print:
223+
bool_true: true
224+
bool_false: false
225+
string: \\"test string\\"
226+
int: 1
227+
float: 3.1415
228+
array_int: [9,8,7,6,5,0,1,2,3,4]
229+
array_bool: [true,false,false,true]
230+
null: null
231+
undefined: null
232+
security_context:
233+
userId: 1
234+
env_var:
235+
exist: \\"test\\"
236+
unknown_fallback: \\"value\\""
237+
`;
238+
239+
exports[`Jinja (new api) render filters.yml.jinja: filters.yml.jinja 1`] = `
240+
"variables:
241+
str_filter: \\"str from python\\"
242+
str_filter_test_arg: \\"my string\\""
243+
`;
244+
245+
exports[`Jinja (new api) render python.yml: python.yml 1`] = `
246+
"test:
247+
unsafe_string: \\"\\"\\\\\\"unsafe string\\\\\\" <>\\"\\"
248+
safe_string: \\"\\"safe string\\" <>\\"
249+
250+
dump:
251+
dict_as_obj: \\"{\\\\n \\\\\\"a_attr\\\\\\": String(\\\\n \\\\\\"value for attribute a\\\\\\",\\\\n Normal,\\\\n ),\\\\n}\\""
252+
`;
253+
254+
exports[`Jinja (new api) render template_error_python.jinja: template_error_python.jinja 1`] = `
255+
[Error: could not render block: Call error: Python error: Exception: Random Exception
256+
Traceback (most recent call last):
257+
File "jinja-instance.py", line 120, in throw_exception
258+
259+
------------------------- template_error_python.jinja -------------------------
260+
3 | 3
261+
4 | 4
262+
5 | 5
263+
6 > {%- set variable = throw_exception() %}
264+
i ^^^^^^^^^^^^^^^^^^^^^^^^ could not render block
265+
7 | 7
266+
8 | 8
267+
9 | 9
268+
-------------------------------------------------------------------------------]
269+
`;
270+
271+
exports[`Jinja (new api) render template_error_syntax.jinja: template_error_syntax.jinja 1`] = `
272+
[Error: syntax error: unknown statement unexpected_block_name
273+
------------------------- template_error_syntax.jinja -------------------------
274+
7 | 7
275+
8 | {%- for country in countries %}
276+
9 | 9
277+
10 > {%- unexpected_block_name %}
278+
i ^^^^^^^^^^^^^^^^^^^^^^^^ syntax error
279+
11 | 11
280+
12 | 12
281+
13 | 13
282+
-------------------------------------------------------------------------------]
283+
`;
284+
285+
exports[`Jinja (new api) render variables.yml.jinja: variables.yml.jinja 1`] = `
286+
"variables:
287+
var1: \\"test string\\"
288+
var2: true
289+
var3: false
290+
var4: null
291+
var5: {\\"obj_key\\":\\"val\\"}
292+
var6: [1,2,3,4,5,6]
293+
var7: [6,5,4,3,2,1]"
294+
`;

0 commit comments

Comments
 (0)