Skip to content

Commit 738a720

Browse files
feldera-botrivudhk
authored andcommitted
[ci] apply automatic fixes
Signed-off-by: feldera-bot <feldera-bot@feldera.com>
1 parent 4c8b2f3 commit 738a720

File tree

2 files changed

+113
-23
lines changed

2 files changed

+113
-23
lines changed

python/tests/runtime_aggtest/illarg_tests/date_time_fn.py

Lines changed: 74 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
class illarg_date_trunc_legal(TstView):
77
def __init__(self):
88
# checked manually
9-
self.data = [{'tmestmp': '2020-06-01T00:00:00', 'datee': '2020-06-01'}]
9+
self.data = [{"tmestmp": "2020-06-01T00:00:00", "datee": "2020-06-01"}]
1010
self.sql = """CREATE MATERIALIZED VIEW date_trunc_legal AS SELECT
1111
DATE_TRUNC(tmestmp, MONTH) AS tmestmp,
1212
DATE_TRUNC(datee, MONTH) AS datee
@@ -29,7 +29,24 @@ def __init__(self):
2929
class illarg_extract_legal(TstView):
3030
def __init__(self):
3131
# checked manually
32-
self.data = [{'yr': 2020, 'yr1': 2020, 'mth': 6, 'mth1': 6, 'day': 21, 'day1': 21, 'dow': 1, 'dow1': 1, 'hr': 14, 'hr1': 0, 'min': 23, 'min1': 0, 'sec': 44, 'sec1': 0}]
32+
self.data = [
33+
{
34+
"yr": 2020,
35+
"yr1": 2020,
36+
"mth": 6,
37+
"mth1": 6,
38+
"day": 21,
39+
"day1": 21,
40+
"dow": 1,
41+
"dow1": 1,
42+
"hr": 14,
43+
"hr1": 0,
44+
"min": 23,
45+
"min1": 0,
46+
"sec": 44,
47+
"sec1": 0,
48+
}
49+
]
3350
self.sql = """CREATE MATERIALIZED VIEW extract_legal AS SELECT
3451
EXTRACT(YEAR FROM tmestmp) AS yr,
3552
EXTRACT(YEAR FROM datee) AS yr1,
@@ -64,7 +81,24 @@ def __init__(self):
6481
class illarg_extract_abrv_legal(TstView):
6582
def __init__(self):
6683
# checked manually
67-
self.data =[{'yr': 2020, 'yr1': 2020, 'mth': 6, 'mth1': 6, 'day': 21, 'day1': 21, 'dow': 1, 'dow1': 1, 'hr': 14, 'hr1': 0, 'min': 23, 'min1': 0, 'sec': 44, 'sec1': 0}]
84+
self.data = [
85+
{
86+
"yr": 2020,
87+
"yr1": 2020,
88+
"mth": 6,
89+
"mth1": 6,
90+
"day": 21,
91+
"day1": 21,
92+
"dow": 1,
93+
"dow1": 1,
94+
"hr": 14,
95+
"hr1": 0,
96+
"min": 23,
97+
"min1": 0,
98+
"sec": 44,
99+
"sec1": 0,
100+
}
101+
]
68102
self.sql = """CREATE MATERIALIZED VIEW extract_abrv_legal AS SELECT
69103
YEAR(tmestmp) AS yr,
70104
YEAR(datee) AS yr1,
@@ -87,7 +121,24 @@ def __init__(self):
87121
class illarg_extract_abrv1_legal(TstView):
88122
def __init__(self):
89123
# checked manually
90-
self.data = [{'yr': 2020, 'yr1': 2020, 'mth': 6, 'mth1': 6, 'day': 21, 'day1': 21, 'dow': 1, 'dow1': 1, 'hr': 14, 'hr1': 0, 'min': 23, 'min1': 0, 'sec': 44, 'sec1': 0}]
124+
self.data = [
125+
{
126+
"yr": 2020,
127+
"yr1": 2020,
128+
"mth": 6,
129+
"mth1": 6,
130+
"day": 21,
131+
"day1": 21,
132+
"dow": 1,
133+
"dow1": 1,
134+
"hr": 14,
135+
"hr1": 0,
136+
"min": 23,
137+
"min1": 0,
138+
"sec": 44,
139+
"sec1": 0,
140+
}
141+
]
91142
self.sql = """CREATE MATERIALIZED VIEW extract_abrv1_legal AS SELECT
92143
DATE_PART(YEAR, tmestmp) AS yr,
93144
DATE_PART(YEAR, datee) AS yr1,
@@ -111,7 +162,9 @@ def __init__(self):
111162
class illarg_floor_legal(TstView):
112163
def __init__(self):
113164
# checked manually
114-
self.data = [{'yr': '2020-01-01T00:00:00', 'mth': '2020-06-01', 'hr': '14:00:00'}]
165+
self.data = [
166+
{"yr": "2020-01-01T00:00:00", "mth": "2020-06-01", "hr": "14:00:00"}
167+
]
115168
self.sql = """CREATE MATERIALIZED VIEW floor_legal AS SELECT
116169
FLOOR(tmestmp TO YEAR) AS yr,
117170
FLOOR(datee TO MONTH) AS mth,
@@ -135,7 +188,9 @@ def __init__(self):
135188
class illarg_ceil_legal(TstView):
136189
def __init__(self):
137190
# checked manually
138-
self.data = [{'yr': '2021-01-01T00:00:00', 'mth': '2020-07-01', 'hr': '15:00:00'}]
191+
self.data = [
192+
{"yr": "2021-01-01T00:00:00", "mth": "2020-07-01", "hr": "15:00:00"}
193+
]
139194
self.sql = """CREATE MATERIALIZED VIEW ceil_legal AS SELECT
140195
CEIL(tmestmp TO YEAR) AS yr,
141196
CEIL(datee TO MONTH) AS mth,
@@ -159,7 +214,7 @@ def __init__(self):
159214
class illarg_tsdiff_legal(TstView):
160215
def __init__(self):
161216
# checked manually
162-
self.data = [{'yr': 1, 'mth': 19, 'hr': 6}]
217+
self.data = [{"yr": 1, "mth": 19, "hr": 6}]
163218
self.sql = """CREATE MATERIALIZED VIEW tsdiff_legal AS SELECT
164219
TIMESTAMPDIFF(YEAR, tmestmp, '2022-01-22 20:24:44'::TIMESTAMP) AS yr,
165220
TIMESTAMPDIFF(MONTH, datee, '2022-01-22'::DATE) AS mth,
@@ -183,7 +238,9 @@ def __init__(self):
183238
class illarg_tsadd_legal(TstView):
184239
def __init__(self):
185240
# checked manually
186-
self.data = [{'yr': '2022-06-21T14:23:44', 'mth': '2020-08-21', 'hr': '16:23:44'}]
241+
self.data = [
242+
{"yr": "2022-06-21T14:23:44", "mth": "2020-08-21", "hr": "16:23:44"}
243+
]
187244
self.sql = """CREATE MATERIALIZED VIEW tsadd_legal AS SELECT
188245
TIMESTAMPADD(YEAR, 2, tmestmp) AS yr,
189246
TIMESTAMPADD(MONTH, 2, datee) AS mth,
@@ -207,22 +264,24 @@ def __init__(self):
207264
class illarg_format_date_legal(TstView):
208265
def __init__(self):
209266
# checked manually
210-
self.data = [{'datee': '2020-06'}]
267+
self.data = [{"datee": "2020-06"}]
211268
self.sql = """CREATE MATERIALIZED VIEW format_date_legal AS SELECT
212269
FORMAT_DATE('%Y-%m', datee) AS datee
213270
FROM illegal_tbl
214271
WHERE id = 0"""
215272

273+
216274
class illarg_format_date_cast_legal(TstView):
217275
def __init__(self):
218276
# checked manually
219-
self.data = [{'tmestmp': '2020-06', 'arr': '2021-01'}]
277+
self.data = [{"tmestmp": "2020-06", "arr": "2021-01"}]
220278
self.sql = """CREATE MATERIALIZED VIEW format_date_cast_legal AS SELECT
221279
FORMAT_DATE('%Y-%m', tmestmp) AS tmestmp,
222280
FORMAT_DATE('%Y-%m', ARR[4]) AS arr
223281
FROM illegal_tbl
224282
WHERE id = 1"""
225283

284+
226285
# Negative Test
227286
class illarg_format_date_illegal(TstView):
228287
def __init__(self):
@@ -238,7 +297,7 @@ def __init__(self):
238297
class illarg_parse_date_legal(TstView):
239298
def __init__(self):
240299
# checked manually
241-
self.data = [{'datee': '2021-01-20'}]
300+
self.data = [{"datee": "2021-01-20"}]
242301
self.sql = """CREATE MATERIALIZED VIEW parse_date_legal AS SELECT
243302
PARSE_DATE('%Y-%m-%d', ARR[4]) AS datee
244303
FROM illegal_tbl
@@ -249,7 +308,7 @@ def __init__(self):
249308
class illarg_parse_date_illegal(TstView):
250309
def __init__(self):
251310
# checked manually
252-
self.data = [{'booll': None}]
311+
self.data = [{"booll": None}]
253312
self.sql = """CREATE MATERIALIZED VIEW parse_date_illegal AS SELECT
254313
PARSE_DATE('%Y-%m', booll) AS booll
255314
FROM illegal_tbl
@@ -260,11 +319,12 @@ def __init__(self):
260319
# PARSE_TIMESTAMP
261320
# PARSE_TIME
262321

322+
263323
# TIMESTAMP_TRUNC
264324
class illarg_trunc_ts_legal(TstView):
265325
def __init__(self):
266326
# checked manually
267-
self.data = [{'tmestmp': '2020-06-01T00:00:00'}]
327+
self.data = [{"tmestmp": "2020-06-01T00:00:00"}]
268328
self.sql = """CREATE MATERIALIZED VIEW ts_trunc_legal AS SELECT
269329
TIMESTAMP_TRUNC(tmestmp, MONTH) AS tmestmp
270330
FROM illegal_tbl
@@ -274,7 +334,7 @@ def __init__(self):
274334
class illarg_ts_trunc_cast_legal(TstView):
275335
def __init__(self):
276336
# checked manually
277-
self.data = [{'datee': '2020-06-01T00:00:00'}]
337+
self.data = [{"datee": "2020-06-01T00:00:00"}]
278338
self.sql = """CREATE MATERIALIZED VIEW ts_trunc_cast_legal AS SELECT
279339
TIMESTAMP_TRUNC(datee, MONTH) AS datee
280340
FROM illegal_tbl
@@ -290,6 +350,3 @@ def __init__(self):
290350
FROM illegal_tbl
291351
WHERE id = 1"""
292352
self.expected_error = "Cannot apply 'TIMESTAMP_TRUNC' to arguments of type"
293-
294-
295-

python/tests/runtime_aggtest/illarg_tests/str_unicode_fn.py

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,13 @@ def __init__(self):
374374
class illarg_bin_concat_fn(TstView):
375375
def __init__(self):
376376
# checked manually
377-
self.data = [{'str': 'h@pP√ h@pP√ '}, {'str': \\_(ツ)_/¯¯\\_(ツ)_/¯'}, {'str': 'かわいいかわいい'}, {'str': '🐍🐍🐍🐍'}, {'str': None}]
377+
self.data = [
378+
{"str": "h@pP√ h@pP√ "},
379+
{"str": \\_(ツ)_/¯¯\\_(ツ)_/¯"},
380+
{"str": "かわいいかわいい"},
381+
{"str": "🐍🐍🐍🐍"},
382+
{"str": None},
383+
]
378384
self.sql = """CREATE MATERIALIZED VIEW bin_concat_fn AS SELECT
379385
str || str AS str
380386
FROM str_tbl"""
@@ -384,7 +390,13 @@ def __init__(self):
384390
class illarg_bin_octet_length_fn(TstView):
385391
def __init__(self):
386392
# Validated on Postgres
387-
self.data = [{'id': 0, 'str': 8}, {'id': 1, 'str': 12}, {'id': 2, 'str': 13}, {'id': 3, 'str': 8}, {'id': 4, 'str': None}]
393+
self.data = [
394+
{"id": 0, "str": 8},
395+
{"id": 1, "str": 12},
396+
{"id": 2, "str": 13},
397+
{"id": 3, "str": 8},
398+
{"id": 4, "str": None},
399+
]
388400
self.sql = """CREATE MATERIALIZED VIEW bin_octet_length_fn AS SELECT
389401
id,
390402
OCTET_LENGTH(str) AS str
@@ -395,7 +407,13 @@ def __init__(self):
395407
class illarg_bin_overlay_legal(TstView):
396408
def __init__(self):
397409
# checked manually
398-
self.data = [{'str': 'hbye√ '}, {'str': '¯byeツ)_/¯'}, {'str': 'かbye'}, {'str': '🐍bye'}, {'str': None}]
410+
self.data = [
411+
{"str": "hbye√ "},
412+
{"str": "¯byeツ)_/¯"},
413+
{"str": "かbye"},
414+
{"str": "🐍bye"},
415+
{"str": None},
416+
]
399417
self.sql = """CREATE MATERIALIZED VIEW bin_overlay_legal AS SELECT
400418
CASE
401419
WHEN id = 0 THEN OVERLAY(str placing 'bye' from 2 for 3)
@@ -411,29 +429,44 @@ def __init__(self):
411429
class illarg_bin_to_hex_fn(TstView):
412430
def __init__(self):
413431
# Validated on Postgres
414-
self.data = [{'id': 0, 'str': 'f09f908df09f908d'}, {'id': 1, 'str': 'e3818be3828fe38184e38184'}, {'id': 2, 'str': 'c2af5c5f28e38384295f2fc2af'}, {'id': 3, 'str': '68407050e2889a20'}, {'id': 4, 'str': None}]
432+
self.data = [
433+
{"id": 0, "str": "f09f908df09f908d"},
434+
{"id": 1, "str": "e3818be3828fe38184e38184"},
435+
{"id": 2, "str": "c2af5c5f28e38384295f2fc2af"},
436+
{"id": 3, "str": "68407050e2889a20"},
437+
{"id": 4, "str": None},
438+
]
415439
self.sql = """CREATE MATERIALIZED VIEW bin_to_hex_fn AS SELECT
416440
id,
417441
TO_HEX(str) AS str
418442
FROM str_tbl"""
419443

444+
420445
# SELECT
421446
# id,
422447
# encode(convert_to(str, 'UTF8'), 'hex') AS str_hex
423448
# FROM str_tbl;
424449

450+
425451
# TO_INT
426452
class illarg_bin_to_int_fn(TstView):
427453
def __init__(self):
428454
# Validated on Postgres
429-
self.data = [{'id': 0, 'str_to_int': -257978227}, {'id': 1, 'str_to_int': - 478049309}, {'id': 2, 'str_to_int': - 1028694945}, {'id': 3, 'str_to_int': 1749053520}, {'id': 4, 'str_to_int': None}]
455+
self.data = [
456+
{"id": 0, "str_to_int": -257978227},
457+
{"id": 1, "str_to_int": -478049309},
458+
{"id": 2, "str_to_int": -1028694945},
459+
{"id": 3, "str_to_int": 1749053520},
460+
{"id": 4, "str_to_int": None},
461+
]
430462
self.sql = """CREATE MATERIALIZED VIEW bin_to_int_fn AS SELECT
431463
id,
432464
TO_INT(str) AS str_to_int
433465
FROM str_tbl"""
434466

467+
435468
# SELECT
436469
# ('x' || 'f09f908df09f908d')::bit(32)::int,
437470
# ('x' || 'e3818be3828fe38184e38184')::bit(32)::int,
438471
# ('x' || 'c2af5c5f28e38384295f2fc2af')::bit(32)::int,
439-
# ('x' || '68407050e2889a20')::bit(32)::int;
472+
# ('x' || '68407050e2889a20')::bit(32)::int;

0 commit comments

Comments
 (0)