fakesnow 0.7.1__py3-none-any.whl → 0.8.0__py3-none-any.whl
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.
- fakesnow/fakes.py +2 -5
- fakesnow/info_schema.py +1 -2
- fakesnow/transforms.py +8 -9
- {fakesnow-0.7.1.dist-info → fakesnow-0.8.0.dist-info}/METADATA +1 -1
- fakesnow-0.8.0.dist-info/RECORD +13 -0
- fakesnow-0.7.1.dist-info/RECORD +0 -13
- {fakesnow-0.7.1.dist-info → fakesnow-0.8.0.dist-info}/LICENSE +0 -0
- {fakesnow-0.7.1.dist-info → fakesnow-0.8.0.dist-info}/WHEEL +0 -0
- {fakesnow-0.7.1.dist-info → fakesnow-0.8.0.dist-info}/top_level.txt +0 -0
fakesnow/fakes.py
CHANGED
@@ -322,13 +322,10 @@ class FakeSnowflakeCursor:
|
|
322
322
|
return ResultMetadata(
|
323
323
|
name=column_name, type_code=12, display_size=None, internal_size=None, precision=0, scale=9, is_nullable=True # noqa: E501
|
324
324
|
)
|
325
|
-
elif column_type == "JSON[]":
|
326
|
-
return ResultMetadata(
|
327
|
-
name=column_name, type_code=10, display_size=None, internal_size=None, precision=None, scale=None, is_nullable=True # noqa: E501
|
328
|
-
)
|
329
325
|
elif column_type == "JSON":
|
326
|
+
# TODO: correctly map OBJECT and ARRAY see https://github.com/tekumara/fakesnow/issues/26
|
330
327
|
return ResultMetadata(
|
331
|
-
name=column_name, type_code=
|
328
|
+
name=column_name, type_code=5, display_size=None, internal_size=None, precision=None, scale=None, is_nullable=True # noqa: E501
|
332
329
|
)
|
333
330
|
else:
|
334
331
|
# TODO handle more types
|
fakesnow/info_schema.py
CHANGED
@@ -40,8 +40,7 @@ case when starts_with(data_type, 'DECIMAL') or data_type='BIGINT' then 'NUMBER'
|
|
40
40
|
when data_type='DOUBLE' then 'FLOAT'
|
41
41
|
when data_type='BLOB' then 'BINARY'
|
42
42
|
when data_type='TIMESTAMP' then 'TIMESTAMP_NTZ'
|
43
|
-
when data_type='JSON
|
44
|
-
when data_type='JSON' then 'OBJECT'
|
43
|
+
when data_type='JSON' then 'VARIANT'
|
45
44
|
else data_type end as data_type,
|
46
45
|
ext_character_maximum_length as character_maximum_length, ext_character_octet_length as character_octet_length,
|
47
46
|
case when data_type='BIGINT' then 38
|
fakesnow/transforms.py
CHANGED
@@ -578,15 +578,14 @@ def semi_structured_types(expression: exp.Expression) -> exp.Expression:
|
|
578
578
|
exp.Expression: The transformed expression.
|
579
579
|
"""
|
580
580
|
|
581
|
-
if isinstance(expression, exp.DataType)
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
return new
|
581
|
+
if isinstance(expression, exp.DataType) and expression.this in [
|
582
|
+
exp.DataType.Type.ARRAY,
|
583
|
+
exp.DataType.Type.OBJECT,
|
584
|
+
exp.DataType.Type.VARIANT,
|
585
|
+
]:
|
586
|
+
new = expression.copy()
|
587
|
+
new.args["this"] = exp.DataType.Type.JSON
|
588
|
+
return new
|
590
589
|
|
591
590
|
return expression
|
592
591
|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
fakesnow/__init__.py,sha256=JXg0HSEHSAOSjEE1ZeA_ogNQ2iFXGEuoibQWk7Pz-WM,3133
|
2
|
+
fakesnow/checks.py,sha256=1qVLR0ZB3z3UPij3Hm8hqlkcNLH2QJnwe8OqkoFCwv8,2356
|
3
|
+
fakesnow/expr.py,sha256=CAxuYIUkwI339DQIBzvFF0F-m1tcVGKEPA5rDTzmH9A,892
|
4
|
+
fakesnow/fakes.py,sha256=qYYtgVNeRSDOMRZYrDo4lS3YB1vTmpAPiVQaeILUdAs,21352
|
5
|
+
fakesnow/fixtures.py,sha256=FfVGhfuIQea0_GQKW8H4ZH0DoxrU2ZnMVJj2eobVbnI,518
|
6
|
+
fakesnow/info_schema.py,sha256=maLS3k10ed_NUYVDeSaL9aXDuVGgQSX8mCYzTqMiW0U,4503
|
7
|
+
fakesnow/py.typed,sha256=B-DLSjYBi7pkKjwxCSdpVj2J02wgfJr-E7B1wOUyxYU,80
|
8
|
+
fakesnow/transforms.py,sha256=TIZa6uLbqTQ66j-xXzr7T475RTJLLyrTcVUvB5dgL1A,22894
|
9
|
+
fakesnow-0.8.0.dist-info/LICENSE,sha256=BL6v_VTnU7xdsocviIQJMFr3stX_-uRfTyByo3gRu4M,1071
|
10
|
+
fakesnow-0.8.0.dist-info/METADATA,sha256=pqyCHOXBSQ4O_I2QtxoGYEbiVfmesGj7V0nonJXt_LY,5418
|
11
|
+
fakesnow-0.8.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
12
|
+
fakesnow-0.8.0.dist-info/top_level.txt,sha256=x8S-sMmvfgNm2_1w0zlIF5YlDs2hR7eNQdVA6TgmPZE,14
|
13
|
+
fakesnow-0.8.0.dist-info/RECORD,,
|
fakesnow-0.7.1.dist-info/RECORD
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
fakesnow/__init__.py,sha256=JXg0HSEHSAOSjEE1ZeA_ogNQ2iFXGEuoibQWk7Pz-WM,3133
|
2
|
-
fakesnow/checks.py,sha256=1qVLR0ZB3z3UPij3Hm8hqlkcNLH2QJnwe8OqkoFCwv8,2356
|
3
|
-
fakesnow/expr.py,sha256=CAxuYIUkwI339DQIBzvFF0F-m1tcVGKEPA5rDTzmH9A,892
|
4
|
-
fakesnow/fakes.py,sha256=SMyZ23KV4qHGkb-RVnWi-5m6IrHGJWETT5RtmRN8er0,21508
|
5
|
-
fakesnow/fixtures.py,sha256=FfVGhfuIQea0_GQKW8H4ZH0DoxrU2ZnMVJj2eobVbnI,518
|
6
|
-
fakesnow/info_schema.py,sha256=3lkpRI_ByXbA1PwZ3hh4PtB9aLAsRbkI4MM_hTaOce8,4544
|
7
|
-
fakesnow/py.typed,sha256=B-DLSjYBi7pkKjwxCSdpVj2J02wgfJr-E7B1wOUyxYU,80
|
8
|
-
fakesnow/transforms.py,sha256=koYkt55qGMJhi8gujqrBKO-nePcBMp4zrTk80Uw_JrE,23054
|
9
|
-
fakesnow-0.7.1.dist-info/LICENSE,sha256=BL6v_VTnU7xdsocviIQJMFr3stX_-uRfTyByo3gRu4M,1071
|
10
|
-
fakesnow-0.7.1.dist-info/METADATA,sha256=5vcf4KPwcNwl7xJ-5fBQmHCxHOatcaTZgFDDPFyUY6E,5418
|
11
|
-
fakesnow-0.7.1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
12
|
-
fakesnow-0.7.1.dist-info/top_level.txt,sha256=x8S-sMmvfgNm2_1w0zlIF5YlDs2hR7eNQdVA6TgmPZE,14
|
13
|
-
fakesnow-0.7.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|