tinybird-toolset 2.5.4__tar.gz → 2.5.5__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.
- {tinybird_toolset-2.5.4/src/tinybird_toolset.egg-info → tinybird_toolset-2.5.5}/PKG-INFO +2 -2
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/README.md +8 -8
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/conf.py +1 -1
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/setup.py +2 -2
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5/src/tinybird_toolset.egg-info}/PKG-INFO +2 -2
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/tests/test_check_compatible_types.py +56 -0
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/tests/test_get_columns_from_create_query.py +101 -0
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/tests/test_normalize_table_column.py +75 -0
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/LICENSE +0 -0
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/MANIFEST.in +0 -0
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/setup.cfg +0 -0
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/src/chtoolset/__init__.py +0 -0
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/src/chtoolset/query.py +0 -0
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/src/tinybird_toolset.egg-info/SOURCES.txt +0 -0
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/src/tinybird_toolset.egg-info/dependency_links.txt +0 -0
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/src/tinybird_toolset.egg-info/requires.txt +0 -0
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/src/tinybird_toolset.egg-info/top_level.txt +0 -0
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/tests/test_check_write_query.py +0 -0
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/tests/test_chquery.py +0 -0
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/tests/test_convert_to_row_binary.py +0 -0
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/tests/test_explain_ast.py +0 -0
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/tests/test_get_left_table.py +0 -0
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/tests/test_internal_cache.py +0 -0
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/tests/test_normalize_query_keep_names.py +0 -0
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/tests/test_parse_create_materialized_view_target_table.py +0 -0
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/tests/test_replace_tables.py +0 -0
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/tests/test_replace_tables_backward_compat.py +0 -0
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/tests/test_rewrite_aggregation_states.py +0 -0
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/tests/test_tables.py +0 -0
- {tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/tests/test_validate_ttl.py +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tinybird-toolset
|
|
3
|
-
Version: 2.5.
|
|
3
|
+
Version: 2.5.5
|
|
4
4
|
Home-page: https://gitlab.com/tinybird/clickhouse-toolset
|
|
5
5
|
Author: Tinybird.co
|
|
6
6
|
Author-email: support@tinybird.co
|
|
7
|
-
Requires-Python: >=3.
|
|
7
|
+
Requires-Python: >=3.13, <3.15
|
|
8
8
|
License-File: LICENSE
|
|
9
9
|
Provides-Extra: test
|
|
10
10
|
Requires-Dist: pytest; extra == "test"
|
|
@@ -70,9 +70,9 @@ You'll also need `objcopy` or `llvm-objcopy` in your path. The latter is more pr
|
|
|
70
70
|
in the bin path of your homebrew llvm installation, so you'll have to do something like: `export PATH="/opt/homebrew/opt/llvm@19/bin:$PATH"`
|
|
71
71
|
|
|
72
72
|
```bash
|
|
73
|
-
make build-3.
|
|
74
|
-
make test-3.
|
|
75
|
-
OMIT_PATCHES=1 make build-3.
|
|
73
|
+
make build-3.13 # Build for Python 3.13
|
|
74
|
+
make test-3.13 # Build and test
|
|
75
|
+
OMIT_PATCHES=1 make build-3.13 # Skip patches on rebuild
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
### Key Profiling Targets
|
|
@@ -113,8 +113,8 @@ make build # Build for all Python versions
|
|
|
113
113
|
make test # Run tests for all Python versions
|
|
114
114
|
|
|
115
115
|
# Or for a specific Python version
|
|
116
|
-
make build-3.
|
|
117
|
-
make test-3.
|
|
116
|
+
make build-3.13 # Build only for Python 3.13
|
|
117
|
+
make test-3.13 # Test only for Python 3.13
|
|
118
118
|
```
|
|
119
119
|
|
|
120
120
|
The Docker image includes:
|
|
@@ -139,7 +139,7 @@ sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
|
|
|
139
139
|
|
|
140
140
|
sudo add-apt-repository ppa:deadsnakes/ppa
|
|
141
141
|
sudo apt update
|
|
142
|
-
sudo apt install python3.
|
|
142
|
+
sudo apt install python3.13-dev python3.14-dev
|
|
143
143
|
|
|
144
144
|
pip3 install virtualenv
|
|
145
145
|
```
|
|
@@ -199,7 +199,7 @@ source ~/.zshrc
|
|
|
199
199
|
|
|
200
200
|
* Follow the normal build. When validating a new machine or toolchain, prefer building a single Python version first:
|
|
201
201
|
```bash
|
|
202
|
-
make build-3.
|
|
202
|
+
make build-3.13
|
|
203
203
|
```
|
|
204
204
|
Then run the full build only after that succeeds:
|
|
205
205
|
```bash
|
|
@@ -283,7 +283,7 @@ export TWINE_PASSWORD=pypi-... # PyPI API token
|
|
|
283
283
|
```
|
|
284
284
|
|
|
285
285
|
The script will:
|
|
286
|
-
- Build wheels for Python 3.
|
|
286
|
+
- Build wheels for Python 3.13-3.14
|
|
287
287
|
- Delocate them (bundle dynamic libraries, set minimum macOS version to 11.0)
|
|
288
288
|
- Run tests for each Python version
|
|
289
289
|
- Upload to PyPI
|
|
@@ -417,7 +417,7 @@ class CustomBuildWithFromCH(build_ext):
|
|
|
417
417
|
|
|
418
418
|
compiler = getattr(self.compiler, "compiler_so")
|
|
419
419
|
if sys.platform == 'darwin':
|
|
420
|
-
# Fix for problem in Apple Silicon Mac with Python 3.
|
|
420
|
+
# Fix for problem in Apple Silicon Mac with Python 3.x
|
|
421
421
|
# both -arch arm64 and -arch x86_64 are included and this collides with
|
|
422
422
|
# other -march option from cflags() (generated by Ninja)
|
|
423
423
|
if 'x86_64' in compiler and 'arm64' in compiler:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from setuptools import setup, Extension
|
|
2
2
|
|
|
3
3
|
NAME = 'tinybird-toolset'
|
|
4
|
-
VERSION = '2.5.
|
|
4
|
+
VERSION = '2.5.5'
|
|
5
5
|
|
|
6
6
|
# Shared metadata for both the full (extension) build and the metadata-only
|
|
7
7
|
# fallback below, so the two setup() calls can't drift apart.
|
|
@@ -13,7 +13,7 @@ common_kwargs = dict(
|
|
|
13
13
|
author_email="support@tinybird.co",
|
|
14
14
|
packages=["chtoolset"],
|
|
15
15
|
package_dir={"": "src"},
|
|
16
|
-
python_requires=">=3.
|
|
16
|
+
python_requires=">=3.13, <3.15",
|
|
17
17
|
install_requires=[],
|
|
18
18
|
)
|
|
19
19
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tinybird-toolset
|
|
3
|
-
Version: 2.5.
|
|
3
|
+
Version: 2.5.5
|
|
4
4
|
Home-page: https://gitlab.com/tinybird/clickhouse-toolset
|
|
5
5
|
Author: Tinybird.co
|
|
6
6
|
Author-email: support@tinybird.co
|
|
7
|
-
Requires-Python: >=3.
|
|
7
|
+
Requires-Python: >=3.13, <3.15
|
|
8
8
|
License-File: LICENSE
|
|
9
9
|
Provides-Extra: test
|
|
10
10
|
Requires-Dist: pytest; extra == "test"
|
|
@@ -357,6 +357,21 @@ class TestCast(unittest.TestCase):
|
|
|
357
357
|
self.assertTrue(chquery.check_compatible_types('AggregateFunction(sum, Int16)', 'AggregateFunction(sum, Int8)'))
|
|
358
358
|
self.assertEqual(str(error.exception), """Different #0 argument: Int16 vs Int8""")
|
|
359
359
|
|
|
360
|
+
def test_works_with_aggregate_functions_over_json(self):
|
|
361
|
+
# Regression test for PLTF-842: resolving an AggregateFunction/
|
|
362
|
+
# SimpleAggregateFunction over a JSON value type used to segfault.
|
|
363
|
+
# DataTypeObject::doGetDefaultSerialization() unconditionally
|
|
364
|
+
# dereferences Context::getGlobalContextInstance() to read the
|
|
365
|
+
# allow_simdjson setting, which is null since chtoolset never runs
|
|
366
|
+
# a real clickhouse-server. See CheckCompatibleTypes.cpp.
|
|
367
|
+
self.assertTrue(chquery.check_compatible_types(
|
|
368
|
+
'AggregateFunction(argMax, JSON, DateTime)',
|
|
369
|
+
'AggregateFunction(argMax, JSON, DateTime)'))
|
|
370
|
+
|
|
371
|
+
self.assertTrue(chquery.check_compatible_types(
|
|
372
|
+
'SimpleAggregateFunction(any, JSON)',
|
|
373
|
+
'SimpleAggregateFunction(any, JSON)'))
|
|
374
|
+
|
|
360
375
|
def test_rejects_if_agg_parameters_are_incompatible(self):
|
|
361
376
|
with self.assertRaises(ValueError) as error:
|
|
362
377
|
self.assertTrue(chquery.check_compatible_types('AggregateFunction(topK, String)', 'AggregateFunction(topK(100), String)'))
|
|
@@ -365,3 +380,44 @@ class TestCast(unittest.TestCase):
|
|
|
365
380
|
with self.assertRaises(ValueError) as error:
|
|
366
381
|
self.assertTrue(chquery.check_compatible_types('AggregateFunction(topK(99), String)', 'AggregateFunction(topK(100), String)'))
|
|
367
382
|
self.assertEqual(str(error.exception), """Different #0 parameter: 99 vs 100""")
|
|
383
|
+
|
|
384
|
+
# Nested/composed types that must resolve without crashing. Covers PLTF-842
|
|
385
|
+
# (JSON nested inside Array/Map/Tuple/Nested/AggregateFunction combinators,
|
|
386
|
+
# which all previously segfaulted resolving JSON's default serialization
|
|
387
|
+
# without a global ClickHouse Context) plus general composed-type coverage.
|
|
388
|
+
NESTED_AND_COMPOSED_TYPES = [
|
|
389
|
+
'Array(JSON)',
|
|
390
|
+
'Map(String, JSON)',
|
|
391
|
+
'Tuple(JSON, String)',
|
|
392
|
+
'Tuple(a JSON, b String)',
|
|
393
|
+
'Nullable(JSON)',
|
|
394
|
+
'Nested(a JSON, b String)',
|
|
395
|
+
'AggregateFunction(argMax, Array(JSON), DateTime)',
|
|
396
|
+
'AggregateFunction(argMax, Map(String, JSON), DateTime)',
|
|
397
|
+
'AggregateFunction(argMax, Tuple(JSON, String), DateTime)',
|
|
398
|
+
'SimpleAggregateFunction(any, Array(JSON))',
|
|
399
|
+
'Array(AggregateFunction(argMax, JSON, DateTime))',
|
|
400
|
+
'Array(LowCardinality(String))',
|
|
401
|
+
'Map(String, LowCardinality(String))',
|
|
402
|
+
'Array(Nullable(Int64))',
|
|
403
|
+
'Map(String, Nullable(Int64))',
|
|
404
|
+
'Map(String, AggregateFunction(sum, Int64))',
|
|
405
|
+
'Nested(a UInt64, b String)',
|
|
406
|
+
'Tuple(x Float64, y Float64)',
|
|
407
|
+
'Array(Tuple(UInt8, String))',
|
|
408
|
+
'Array(Array(String))',
|
|
409
|
+
'Map(String, Array(String))',
|
|
410
|
+
'Map(String, Map(String, Int64))',
|
|
411
|
+
'Variant(String, Int64)',
|
|
412
|
+
'Dynamic',
|
|
413
|
+
'LowCardinality(Nullable(String))',
|
|
414
|
+
]
|
|
415
|
+
|
|
416
|
+
def test_nested_and_composed_types_self_compatible(self):
|
|
417
|
+
for type_str in self.NESTED_AND_COMPOSED_TYPES:
|
|
418
|
+
with self.subTest(type_str):
|
|
419
|
+
self.assertTrue(chquery.check_compatible_types(type_str, type_str))
|
|
420
|
+
|
|
421
|
+
def test_low_cardinality_of_json_is_rejected(self):
|
|
422
|
+
with self.assertRaisesRegex(ValueError, 'DataTypeLowCardinality is supported only for'):
|
|
423
|
+
chquery.check_compatible_types('LowCardinality(JSON)', 'LowCardinality(JSON)')
|
{tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/tests/test_get_columns_from_create_query.py
RENAMED
|
@@ -670,6 +670,107 @@ class TestGetColumnsFromCreateQuery(unittest.TestCase):
|
|
|
670
670
|
'is_primary_key': False,
|
|
671
671
|
})
|
|
672
672
|
|
|
673
|
+
def test_aggregate_function_over_json_type(self):
|
|
674
|
+
"""Regression test for PLTF-842: resolving an AggregateFunction over a
|
|
675
|
+
JSON value type used to segfault inside columnInfoFromColumnDeclaration
|
|
676
|
+
(functions/NormalizeColumnsFromDict.cpp), which calls DataTypeFactory
|
|
677
|
+
without a global ClickHouse Context. JSON's default serialization reads
|
|
678
|
+
that context unconditionally to check the allow_simdjson setting."""
|
|
679
|
+
sql = """
|
|
680
|
+
CREATE TABLE test (
|
|
681
|
+
id UInt64,
|
|
682
|
+
payload AggregateFunction(argMax, JSON, DateTime)
|
|
683
|
+
) ENGINE = AggregatingMergeTree() ORDER BY id
|
|
684
|
+
"""
|
|
685
|
+
cols = chquery.get_columns_from_create_query(sql)
|
|
686
|
+
self.assertEqual(len(cols), 2)
|
|
687
|
+
|
|
688
|
+
self.assertColumnEquals(cols[1], {
|
|
689
|
+
'name': 'payload',
|
|
690
|
+
'type': 'AggregateFunction(argMax, JSON, DateTime)',
|
|
691
|
+
'nullable': False,
|
|
692
|
+
'default_specifier': '',
|
|
693
|
+
'default_expression': None,
|
|
694
|
+
'codec': None,
|
|
695
|
+
'comment': None,
|
|
696
|
+
'ttl': None,
|
|
697
|
+
'is_primary_key': False,
|
|
698
|
+
})
|
|
699
|
+
|
|
700
|
+
# Nested/composed type -> expected (normalized_type, nullable). Covers PLTF-842
|
|
701
|
+
# (JSON nested inside Array/Map/Tuple/Nested/AggregateFunction combinators, which
|
|
702
|
+
# all previously segfaulted resolving JSON's default serialization without a
|
|
703
|
+
# global ClickHouse Context) plus general composed-type coverage so any similar
|
|
704
|
+
# gap for other types would show up here too.
|
|
705
|
+
NESTED_AND_COMPOSED_TYPES = [
|
|
706
|
+
('Array(JSON)', ('Array(JSON)', False)),
|
|
707
|
+
('Map(String, JSON)', ('Map(String, JSON)', False)),
|
|
708
|
+
('Tuple(JSON, String)', ('Tuple(JSON, String)', False)),
|
|
709
|
+
('Tuple(a JSON, b String)', ('Tuple(a JSON, b String)', False)),
|
|
710
|
+
('Nullable(JSON)', ('Nullable(JSON)', True)),
|
|
711
|
+
('Nested(a JSON, b String)', ('Nested(a JSON, b String)', False)),
|
|
712
|
+
('AggregateFunction(argMax, JSON, DateTime)', ('AggregateFunction(argMax, JSON, DateTime)', False)),
|
|
713
|
+
('AggregateFunction(argMax, Array(JSON), DateTime)', ('AggregateFunction(argMax, Array(JSON), DateTime)', False)),
|
|
714
|
+
('AggregateFunction(argMax, Map(String, JSON), DateTime)', ('AggregateFunction(argMax, Map(String, JSON), DateTime)', False)),
|
|
715
|
+
('AggregateFunction(argMax, Tuple(JSON, String), DateTime)', ('AggregateFunction(argMax, Tuple(JSON, String), DateTime)', False)),
|
|
716
|
+
('SimpleAggregateFunction(any, JSON)', ('SimpleAggregateFunction(any, JSON)', False)),
|
|
717
|
+
('SimpleAggregateFunction(any, Array(JSON))', ('SimpleAggregateFunction(any, Array(JSON))', False)),
|
|
718
|
+
('Array(AggregateFunction(argMax, JSON, DateTime))', ('Array(AggregateFunction(argMax, JSON, DateTime))', False)),
|
|
719
|
+
('Array(LowCardinality(String))', ('Array(LowCardinality(String))', False)),
|
|
720
|
+
('Map(String, LowCardinality(String))', ('Map(String, LowCardinality(String))', False)),
|
|
721
|
+
('Array(Nullable(Int64))', ('Array(Nullable(Int64))', False)),
|
|
722
|
+
('Map(String, Nullable(Int64))', ('Map(String, Nullable(Int64))', False)),
|
|
723
|
+
('Map(String, AggregateFunction(sum, Int64))', ('Map(String, AggregateFunction(sum, Int64))', False)),
|
|
724
|
+
('Nested(a UInt64, b String)', ('Nested(a UInt64, b String)', False)),
|
|
725
|
+
('Tuple(x Float64, y Float64)', ('Tuple(x Float64, y Float64)', False)),
|
|
726
|
+
('Array(Tuple(UInt8, String))', ('Array(Tuple(UInt8, String))', False)),
|
|
727
|
+
('Array(Array(String))', ('Array(Array(String))', False)),
|
|
728
|
+
('Map(String, Array(String))', ('Map(String, Array(String))', False)),
|
|
729
|
+
('Map(String, Map(String, Int64))', ('Map(String, Map(String, Int64))', False)),
|
|
730
|
+
('Variant(String, Int64)', ('Variant(String, Int64)', False)),
|
|
731
|
+
('Dynamic', ('Dynamic', False)),
|
|
732
|
+
('LowCardinality(Nullable(String))', ('LowCardinality(Nullable(String))', True)),
|
|
733
|
+
]
|
|
734
|
+
|
|
735
|
+
def test_nested_and_composed_types(self):
|
|
736
|
+
"""Regression test for PLTF-842 plus general coverage: resolving nested
|
|
737
|
+
and composed types (Array/Map/Tuple/Nested/AggregateFunction combinators,
|
|
738
|
+
including JSON nested inside them) must not crash columnInfoFromColumnDeclaration
|
|
739
|
+
(functions/NormalizeColumnsFromDict.cpp)."""
|
|
740
|
+
for type_str, (expected_type, expected_nullable) in self.NESTED_AND_COMPOSED_TYPES:
|
|
741
|
+
with self.subTest(type_str):
|
|
742
|
+
sql = f"""
|
|
743
|
+
CREATE TABLE test (
|
|
744
|
+
id UInt64,
|
|
745
|
+
col {type_str}
|
|
746
|
+
) ENGINE = AggregatingMergeTree() ORDER BY id
|
|
747
|
+
"""
|
|
748
|
+
cols = chquery.get_columns_from_create_query(sql)
|
|
749
|
+
self.assertEqual(len(cols), 2)
|
|
750
|
+
self.assertColumnEquals(cols[1], {
|
|
751
|
+
'name': 'col',
|
|
752
|
+
'type': expected_type,
|
|
753
|
+
'nullable': expected_nullable,
|
|
754
|
+
'default_specifier': '',
|
|
755
|
+
'default_expression': None,
|
|
756
|
+
'codec': None,
|
|
757
|
+
'comment': None,
|
|
758
|
+
'ttl': None,
|
|
759
|
+
'is_primary_key': False,
|
|
760
|
+
})
|
|
761
|
+
|
|
762
|
+
def test_low_cardinality_of_json_is_rejected(self):
|
|
763
|
+
"""LowCardinality only supports numbers, strings, Date or DateTime; JSON
|
|
764
|
+
must be rejected with a clear error rather than crashing."""
|
|
765
|
+
sql = """
|
|
766
|
+
CREATE TABLE test (
|
|
767
|
+
id UInt64,
|
|
768
|
+
col LowCardinality(JSON)
|
|
769
|
+
) ENGINE = AggregatingMergeTree() ORDER BY id
|
|
770
|
+
"""
|
|
771
|
+
with self.assertRaisesRegex(ValueError, 'DataTypeLowCardinality is supported only for'):
|
|
772
|
+
chquery.get_columns_from_create_query(sql)
|
|
773
|
+
|
|
673
774
|
def test_invalid_query(self):
|
|
674
775
|
"""Test that invalid queries raise appropriate errors"""
|
|
675
776
|
with self.assertRaises(ValueError):
|
|
@@ -390,6 +390,81 @@ class TestNormalizeTableColumn(unittest.TestCase):
|
|
|
390
390
|
|
|
391
391
|
self.assertEqual(column["type"], "Float64")
|
|
392
392
|
|
|
393
|
+
def test_aggregate_function_over_json_type(self):
|
|
394
|
+
# Regression test for PLTF-842: normalizeColumnInfo() calls
|
|
395
|
+
# columnInfoFromColumnDeclaration() (functions/NormalizeColumnsFromDict.cpp),
|
|
396
|
+
# which used to segfault resolving an AggregateFunction over a JSON value
|
|
397
|
+
# type via DataTypeFactory without a global ClickHouse Context.
|
|
398
|
+
column = chquery.normalize_table_column(
|
|
399
|
+
column={
|
|
400
|
+
"name": "payload",
|
|
401
|
+
"normalized_name": "payload",
|
|
402
|
+
"type": "AggregateFunction(argMax, JSON, DateTime)",
|
|
403
|
+
"nullable": False,
|
|
404
|
+
},
|
|
405
|
+
)
|
|
406
|
+
|
|
407
|
+
self.assertEqual(column["type"], "AggregateFunction(argMax, JSON, DateTime)")
|
|
408
|
+
self.assertFalse(column["nullable"])
|
|
409
|
+
|
|
410
|
+
# Nested/composed type -> expected (normalized_type, nullable). Covers PLTF-842
|
|
411
|
+
# (JSON nested inside Array/Map/Tuple/Nested/AggregateFunction combinators)
|
|
412
|
+
# plus general composed-type coverage for normalizeColumnInfo()
|
|
413
|
+
# (functions/NormalizeColumnsFromDict.cpp).
|
|
414
|
+
NESTED_AND_COMPOSED_TYPES = [
|
|
415
|
+
('Array(JSON)', ('Array(JSON)', False)),
|
|
416
|
+
('Map(String, JSON)', ('Map(String, JSON)', False)),
|
|
417
|
+
('Tuple(JSON, String)', ('Tuple(JSON, String)', False)),
|
|
418
|
+
('Tuple(a JSON, b String)', ('Tuple(a JSON, b String)', False)),
|
|
419
|
+
('Nullable(JSON)', ('Nullable(JSON)', True)),
|
|
420
|
+
('Nested(a JSON, b String)', ('Nested(a JSON, b String)', False)),
|
|
421
|
+
('AggregateFunction(argMax, Array(JSON), DateTime)', ('AggregateFunction(argMax, Array(JSON), DateTime)', False)),
|
|
422
|
+
('AggregateFunction(argMax, Map(String, JSON), DateTime)', ('AggregateFunction(argMax, Map(String, JSON), DateTime)', False)),
|
|
423
|
+
('AggregateFunction(argMax, Tuple(JSON, String), DateTime)', ('AggregateFunction(argMax, Tuple(JSON, String), DateTime)', False)),
|
|
424
|
+
('SimpleAggregateFunction(any, JSON)', ('SimpleAggregateFunction(any, JSON)', False)),
|
|
425
|
+
('SimpleAggregateFunction(any, Array(JSON))', ('SimpleAggregateFunction(any, Array(JSON))', False)),
|
|
426
|
+
('Array(AggregateFunction(argMax, JSON, DateTime))', ('Array(AggregateFunction(argMax, JSON, DateTime))', False)),
|
|
427
|
+
('Array(LowCardinality(String))', ('Array(LowCardinality(String))', False)),
|
|
428
|
+
('Map(String, LowCardinality(String))', ('Map(String, LowCardinality(String))', False)),
|
|
429
|
+
('Array(Nullable(Int64))', ('Array(Nullable(Int64))', False)),
|
|
430
|
+
('Map(String, Nullable(Int64))', ('Map(String, Nullable(Int64))', False)),
|
|
431
|
+
('Map(String, AggregateFunction(sum, Int64))', ('Map(String, AggregateFunction(sum, Int64))', False)),
|
|
432
|
+
('Nested(a UInt64, b String)', ('Nested(a UInt64, b String)', False)),
|
|
433
|
+
('Tuple(x Float64, y Float64)', ('Tuple(x Float64, y Float64)', False)),
|
|
434
|
+
('Array(Tuple(UInt8, String))', ('Array(Tuple(UInt8, String))', False)),
|
|
435
|
+
('Array(Array(String))', ('Array(Array(String))', False)),
|
|
436
|
+
('Map(String, Array(String))', ('Map(String, Array(String))', False)),
|
|
437
|
+
('Map(String, Map(String, Int64))', ('Map(String, Map(String, Int64))', False)),
|
|
438
|
+
('Variant(String, Int64)', ('Variant(String, Int64)', False)),
|
|
439
|
+
('Dynamic', ('Dynamic', False)),
|
|
440
|
+
('LowCardinality(Nullable(String))', ('LowCardinality(Nullable(String))', True)),
|
|
441
|
+
]
|
|
442
|
+
|
|
443
|
+
def test_nested_and_composed_types(self):
|
|
444
|
+
for type_str, (expected_type, expected_nullable) in self.NESTED_AND_COMPOSED_TYPES:
|
|
445
|
+
with self.subTest(type_str):
|
|
446
|
+
column = chquery.normalize_table_column(
|
|
447
|
+
column={
|
|
448
|
+
"name": "col",
|
|
449
|
+
"normalized_name": "col",
|
|
450
|
+
"type": type_str,
|
|
451
|
+
"nullable": False,
|
|
452
|
+
},
|
|
453
|
+
)
|
|
454
|
+
self.assertEqual(column["type"], expected_type)
|
|
455
|
+
self.assertEqual(column["nullable"], expected_nullable)
|
|
456
|
+
|
|
457
|
+
def test_low_cardinality_of_json_is_rejected(self):
|
|
458
|
+
with self.assertRaisesRegex(ValueError, 'DataTypeLowCardinality is supported only for'):
|
|
459
|
+
chquery.normalize_table_column(
|
|
460
|
+
column={
|
|
461
|
+
"name": "col",
|
|
462
|
+
"normalized_name": "col",
|
|
463
|
+
"type": "LowCardinality(JSON)",
|
|
464
|
+
"nullable": False,
|
|
465
|
+
},
|
|
466
|
+
)
|
|
467
|
+
|
|
393
468
|
def test_default_now_for_created_at(self):
|
|
394
469
|
column = chquery.normalize_table_column(
|
|
395
470
|
column={
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/src/tinybird_toolset.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/src/tinybird_toolset.egg-info/requires.txt
RENAMED
|
File without changes
|
{tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/src/tinybird_toolset.egg-info/top_level.txt
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
|
{tinybird_toolset-2.5.4 → tinybird_toolset-2.5.5}/tests/test_replace_tables_backward_compat.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|