tinybird-toolset 2.8.1__tar.gz → 2.8.3__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.
Files changed (32) hide show
  1. {tinybird_toolset-2.8.1/src/tinybird_toolset.egg-info → tinybird_toolset-2.8.3}/PKG-INFO +1 -1
  2. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/setup.py +1 -1
  3. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3/src/tinybird_toolset.egg-info}/PKG-INFO +1 -1
  4. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/tests/test_convert_to_row_binary.py +14 -0
  5. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/tests/test_replace_tables.py +38 -1
  6. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/LICENSE +0 -0
  7. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/MANIFEST.in +0 -0
  8. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/README.md +0 -0
  9. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/conf.py +0 -0
  10. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/setup.cfg +0 -0
  11. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/src/chtoolset/__init__.py +0 -0
  12. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/src/chtoolset/query.py +0 -0
  13. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/src/tinybird_toolset.egg-info/SOURCES.txt +0 -0
  14. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/src/tinybird_toolset.egg-info/dependency_links.txt +0 -0
  15. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/src/tinybird_toolset.egg-info/requires.txt +0 -0
  16. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/src/tinybird_toolset.egg-info/top_level.txt +0 -0
  17. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/tests/test_check_compatible_types.py +0 -0
  18. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/tests/test_check_ttl_partition_compatibility.py +0 -0
  19. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/tests/test_check_write_query.py +0 -0
  20. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/tests/test_chquery.py +0 -0
  21. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/tests/test_explain_ast.py +0 -0
  22. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/tests/test_get_columns_from_create_query.py +0 -0
  23. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/tests/test_get_left_table.py +0 -0
  24. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/tests/test_internal_cache.py +0 -0
  25. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/tests/test_normalize_query_keep_names.py +0 -0
  26. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/tests/test_normalize_table_column.py +0 -0
  27. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/tests/test_parse_create_materialized_view_target_table.py +0 -0
  28. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/tests/test_replace_tables_backward_compat.py +0 -0
  29. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/tests/test_rewrite_aggregation_states.py +0 -0
  30. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/tests/test_tables.py +0 -0
  31. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/tests/test_validate_partition_key.py +0 -0
  32. {tinybird_toolset-2.8.1 → tinybird_toolset-2.8.3}/tests/test_validate_ttl.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tinybird-toolset
3
- Version: 2.8.1
3
+ Version: 2.8.3
4
4
  Home-page: https://gitlab.com/tinybird/clickhouse-toolset
5
5
  Author: Tinybird.co
6
6
  Author-email: support@tinybird.co
@@ -1,7 +1,7 @@
1
1
  from setuptools import setup, Extension
2
2
 
3
3
  NAME = 'tinybird-toolset'
4
- VERSION = '2.8.1'
4
+ VERSION = '2.8.3'
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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tinybird-toolset
3
- Version: 2.8.1
3
+ Version: 2.8.3
4
4
  Home-page: https://gitlab.com/tinybird/clickhouse-toolset
5
5
  Author: Tinybird.co
6
6
  Author-email: support@tinybird.co
@@ -9079,6 +9079,20 @@ class TestRowBinaryEncoder:
9079
9079
  outputs[type_name] = result
9080
9080
  assert outputs['Tuple(JSON, LowCardinality(String))'] == outputs['Tuple(JSON, String)']
9081
9081
 
9082
+ def test_binary_json_as_string_is_per_encoder(self):
9083
+ schema = json.dumps(get_schema([('v', 'JSON', '$.v', False)]))
9084
+ data = json.dumps({'v': {'a': 1}})
9085
+ outputs = {}
9086
+ for binary_json_as_string in (True, False):
9087
+ with chquery.RowBinaryEncoder(schema, binary_json_as_string=binary_json_as_string, legacy_conversion_mode=False) as encoder:
9088
+ outputs[binary_json_as_string] = encoder.encode(data)[0]
9089
+ assert outputs[True] != outputs[False]
9090
+
9091
+ with chquery.RowBinaryEncoder(schema, binary_json_as_string=True, legacy_conversion_mode=False) as string_encoder:
9092
+ with chquery.RowBinaryEncoder(schema, binary_json_as_string=False, legacy_conversion_mode=False) as binary_encoder:
9093
+ assert string_encoder.encode(data)[0] == outputs[True]
9094
+ assert binary_encoder.encode(data)[0] == outputs[False]
9095
+
9082
9096
  OBJECT_COLUMN_SCRATCH_CASES = [
9083
9097
  # Objects directly in the column: rows 1-2 share a shape (reuse), rows 3-4 don't (reset).
9084
9098
  ('JSON', True,
@@ -125,6 +125,41 @@ class TestReplaceTables(unittest.TestCase):
125
125
  {("", "tt"): ("database", "t_01010101")},
126
126
  "SELECT sum(a) OVER w FROM (SELECT 1 AS a) WINDOW w AS (PARTITION BY a IN (SELECT a FROM database.t_01010101 AS tt))",
127
127
  ),
128
+ (
129
+ "SELECT * FROM tt FINAL WHERE b = 1",
130
+ {("", "tt"): ("", "(select * from database.t_01010101 where a > 1)")},
131
+ "SELECT * FROM (select * from database.t_01010101 FINAL where a > 1) AS tt WHERE b = 1",
132
+ ),
133
+ (
134
+ "SELECT * FROM tt AS t FINAL",
135
+ {("", "tt"): ("", "(select * from (select * from database.t_01010101 where a > 1) where a > 1)")},
136
+ "SELECT * FROM (select * from (select * from database.t_01010101 FINAL where a > 1) where a > 1) AS t",
137
+ ),
138
+ (
139
+ "SELECT * FROM tt FINAL",
140
+ {("", "tt"): ("", "(select * from cluster(c, database.t_01010101) where a > 1)")},
141
+ "SELECT * FROM (select * from cluster(c, database.t_01010101) FINAL where a > 1) AS tt",
142
+ ),
143
+ (
144
+ "SELECT * FROM tt FINAL",
145
+ {("", "tt"): ("", "(select a from table2 group by a)")},
146
+ "SELECT * FROM (select a from table2 group by a) AS tt FINAL",
147
+ ),
148
+ (
149
+ "SELECT * FROM tt FINAL",
150
+ {("", "tt"): ("", "(select count() from table2 where a > 1)")},
151
+ "SELECT * FROM (select count() from table2 where a > 1) AS tt FINAL",
152
+ ),
153
+ (
154
+ "SELECT * FROM tt FINAL",
155
+ {("", "tt"): ("", "(select * apply(sum) from table2 where a > 1)")},
156
+ "SELECT * FROM (select * apply(sum) from table2 where a > 1) AS tt FINAL",
157
+ ),
158
+ (
159
+ "SELECT * FROM tt FINAL",
160
+ {("", "tt"): ("", "(select * from (select a from table2 limit 1) where a > 1)")},
161
+ "SELECT * FROM (select * from (select a from table2 limit 1) where a > 1) AS tt FINAL",
162
+ ),
128
163
  ]
129
164
 
130
165
  def test_asterisks_no_database(self):
@@ -1313,7 +1348,8 @@ class TestDisabledFunctions(unittest.TestCase):
1313
1348
  max_memory_usage = 1000000,
1314
1349
  max_execution_time = 60,
1315
1350
  use_query_condition_cache = 0,
1316
- prefer_column_name_to_alias = 1
1351
+ prefer_column_name_to_alias = 1,
1352
+ final = 1
1317
1353
  """
1318
1354
  replacement = {("default", "a"): ("", "(SELECT count() FROM system.numbers LIMIT 1)")}
1319
1355
  replaced = chquery.replace_tables(sql, replacement, default_database="default")
@@ -1325,6 +1361,7 @@ class TestDisabledFunctions(unittest.TestCase):
1325
1361
  "max_execution_time",
1326
1362
  "use_query_condition_cache",
1327
1363
  "prefer_column_name_to_alias",
1364
+ "final",
1328
1365
  ):
1329
1366
  self.assertIn(key, out)
1330
1367