Skip to content

Commit dfb42f1

Browse files
committed
Update documentation with most recent SQL samples.
1 parent 91fa2ca commit dfb42f1

18 files changed

+211
-187
lines changed

distribution/python/dqops/client/models/column_type_snapshot_spec.py

+9
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@ class ColumnTypeSnapshotSpec:
1717
length (Union[Unset, int]): Maximum length of text and binary columns.
1818
precision (Union[Unset, int]): Precision of a numeric (decimal) data type.
1919
scale (Union[Unset, int]): Scale of a numeric (decimal) data type.
20+
nested (Union[Unset, bool]): This field is a nested field inside another STRUCT. It is used to identify nested
21+
fields in JSON files.
2022
"""
2123

2224
column_type: Union[Unset, str] = UNSET
2325
nullable: Union[Unset, bool] = UNSET
2426
length: Union[Unset, int] = UNSET
2527
precision: Union[Unset, int] = UNSET
2628
scale: Union[Unset, int] = UNSET
29+
nested: Union[Unset, bool] = UNSET
2730
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
2831

2932
def to_dict(self) -> Dict[str, Any]:
@@ -32,6 +35,7 @@ def to_dict(self) -> Dict[str, Any]:
3235
length = self.length
3336
precision = self.precision
3437
scale = self.scale
38+
nested = self.nested
3539

3640
field_dict: Dict[str, Any] = {}
3741
field_dict.update(self.additional_properties)
@@ -46,6 +50,8 @@ def to_dict(self) -> Dict[str, Any]:
4650
field_dict["precision"] = precision
4751
if scale is not UNSET:
4852
field_dict["scale"] = scale
53+
if nested is not UNSET:
54+
field_dict["nested"] = nested
4955

5056
return field_dict
5157

@@ -62,12 +68,15 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
6268

6369
scale = d.pop("scale", UNSET)
6470

71+
nested = d.pop("nested", UNSET)
72+
6573
column_type_snapshot_spec = cls(
6674
column_type=column_type,
6775
nullable=nullable,
6876
length=length,
6977
precision=precision,
7078
scale=scale,
79+
nested=nested,
7180
)
7281

7382
column_type_snapshot_spec.additional_properties = d

distribution/python/dqops/client/models/duckdb_storage_type.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33

44
class DuckdbStorageType(str, Enum):
5+
AZURE = "azure"
56
LOCAL = "local"
67
S3 = "s3"
78

docs/checks/column/text/text-length-above-max-length-percent.md

+20-20
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ spec:
320320
WHEN COUNT({{ lib.render_target_column('analyzed_table') }}) = 0 THEN 0.0
321321
ELSE 100.0 * SUM(
322322
CASE
323-
WHEN LENGTH({{ lib.render_target_column('analyzed_table')}}) > {{(parameters.max_length)}}
323+
WHEN LENGTH(CAST({{ lib.render_target_column('analyzed_table')}} AS CHAR)) > {{(parameters.max_length)}}
324324
THEN 1
325325
ELSE 0
326326
END
@@ -341,7 +341,7 @@ spec:
341341
WHEN COUNT(analyzed_table.`target_column`) = 0 THEN 0.0
342342
ELSE 100.0 * SUM(
343343
CASE
344-
WHEN LENGTH(analyzed_table.`target_column`) > 100
344+
WHEN LENGTH(CAST(analyzed_table.`target_column` AS CHAR)) > 100
345345
THEN 1
346346
ELSE 0
347347
END
@@ -1065,7 +1065,7 @@ Expand the *Configure with data grouping* section to see additional examples for
10651065
WHEN COUNT({{ lib.render_target_column('analyzed_table') }}) = 0 THEN 0.0
10661066
ELSE 100.0 * SUM(
10671067
CASE
1068-
WHEN LENGTH({{ lib.render_target_column('analyzed_table')}}) > {{(parameters.max_length)}}
1068+
WHEN LENGTH(CAST({{ lib.render_target_column('analyzed_table')}} AS CHAR)) > {{(parameters.max_length)}}
10691069
THEN 1
10701070
ELSE 0
10711071
END
@@ -1085,7 +1085,7 @@ Expand the *Configure with data grouping* section to see additional examples for
10851085
WHEN COUNT(analyzed_table.`target_column`) = 0 THEN 0.0
10861086
ELSE 100.0 * SUM(
10871087
CASE
1088-
WHEN LENGTH(analyzed_table.`target_column`) > 100
1088+
WHEN LENGTH(CAST(analyzed_table.`target_column` AS CHAR)) > 100
10891089
THEN 1
10901090
ELSE 0
10911091
END
@@ -1908,7 +1908,7 @@ spec:
19081908
WHEN COUNT({{ lib.render_target_column('analyzed_table') }}) = 0 THEN 0.0
19091909
ELSE 100.0 * SUM(
19101910
CASE
1911-
WHEN LENGTH({{ lib.render_target_column('analyzed_table')}}) > {{(parameters.max_length)}}
1911+
WHEN LENGTH(CAST({{ lib.render_target_column('analyzed_table')}} AS CHAR)) > {{(parameters.max_length)}}
19121912
THEN 1
19131913
ELSE 0
19141914
END
@@ -1929,7 +1929,7 @@ spec:
19291929
WHEN COUNT(analyzed_table.`target_column`) = 0 THEN 0.0
19301930
ELSE 100.0 * SUM(
19311931
CASE
1932-
WHEN LENGTH(analyzed_table.`target_column`) > 100
1932+
WHEN LENGTH(CAST(analyzed_table.`target_column` AS CHAR)) > 100
19331933
THEN 1
19341934
ELSE 0
19351935
END
@@ -2654,7 +2654,7 @@ Expand the *Configure with data grouping* section to see additional examples for
26542654
WHEN COUNT({{ lib.render_target_column('analyzed_table') }}) = 0 THEN 0.0
26552655
ELSE 100.0 * SUM(
26562656
CASE
2657-
WHEN LENGTH({{ lib.render_target_column('analyzed_table')}}) > {{(parameters.max_length)}}
2657+
WHEN LENGTH(CAST({{ lib.render_target_column('analyzed_table')}} AS CHAR)) > {{(parameters.max_length)}}
26582658
THEN 1
26592659
ELSE 0
26602660
END
@@ -2674,7 +2674,7 @@ Expand the *Configure with data grouping* section to see additional examples for
26742674
WHEN COUNT(analyzed_table.`target_column`) = 0 THEN 0.0
26752675
ELSE 100.0 * SUM(
26762676
CASE
2677-
WHEN LENGTH(analyzed_table.`target_column`) > 100
2677+
WHEN LENGTH(CAST(analyzed_table.`target_column` AS CHAR)) > 100
26782678
THEN 1
26792679
ELSE 0
26802680
END
@@ -3497,7 +3497,7 @@ spec:
34973497
WHEN COUNT({{ lib.render_target_column('analyzed_table') }}) = 0 THEN 0.0
34983498
ELSE 100.0 * SUM(
34993499
CASE
3500-
WHEN LENGTH({{ lib.render_target_column('analyzed_table')}}) > {{(parameters.max_length)}}
3500+
WHEN LENGTH(CAST({{ lib.render_target_column('analyzed_table')}} AS CHAR)) > {{(parameters.max_length)}}
35013501
THEN 1
35023502
ELSE 0
35033503
END
@@ -3518,7 +3518,7 @@ spec:
35183518
WHEN COUNT(analyzed_table.`target_column`) = 0 THEN 0.0
35193519
ELSE 100.0 * SUM(
35203520
CASE
3521-
WHEN LENGTH(analyzed_table.`target_column`) > 100
3521+
WHEN LENGTH(CAST(analyzed_table.`target_column` AS CHAR)) > 100
35223522
THEN 1
35233523
ELSE 0
35243524
END
@@ -4243,7 +4243,7 @@ Expand the *Configure with data grouping* section to see additional examples for
42434243
WHEN COUNT({{ lib.render_target_column('analyzed_table') }}) = 0 THEN 0.0
42444244
ELSE 100.0 * SUM(
42454245
CASE
4246-
WHEN LENGTH({{ lib.render_target_column('analyzed_table')}}) > {{(parameters.max_length)}}
4246+
WHEN LENGTH(CAST({{ lib.render_target_column('analyzed_table')}} AS CHAR)) > {{(parameters.max_length)}}
42474247
THEN 1
42484248
ELSE 0
42494249
END
@@ -4263,7 +4263,7 @@ Expand the *Configure with data grouping* section to see additional examples for
42634263
WHEN COUNT(analyzed_table.`target_column`) = 0 THEN 0.0
42644264
ELSE 100.0 * SUM(
42654265
CASE
4266-
WHEN LENGTH(analyzed_table.`target_column`) > 100
4266+
WHEN LENGTH(CAST(analyzed_table.`target_column` AS CHAR)) > 100
42674267
THEN 1
42684268
ELSE 0
42694269
END
@@ -5096,7 +5096,7 @@ spec:
50965096
WHEN COUNT({{ lib.render_target_column('analyzed_table') }}) = 0 THEN 0.0
50975097
ELSE 100.0 * SUM(
50985098
CASE
5099-
WHEN LENGTH({{ lib.render_target_column('analyzed_table')}}) > {{(parameters.max_length)}}
5099+
WHEN LENGTH(CAST({{ lib.render_target_column('analyzed_table')}} AS CHAR)) > {{(parameters.max_length)}}
51005100
THEN 1
51015101
ELSE 0
51025102
END
@@ -5117,7 +5117,7 @@ spec:
51175117
WHEN COUNT(analyzed_table.`target_column`) = 0 THEN 0.0
51185118
ELSE 100.0 * SUM(
51195119
CASE
5120-
WHEN LENGTH(analyzed_table.`target_column`) > 100
5120+
WHEN LENGTH(CAST(analyzed_table.`target_column` AS CHAR)) > 100
51215121
THEN 1
51225122
ELSE 0
51235123
END
@@ -5856,7 +5856,7 @@ Expand the *Configure with data grouping* section to see additional examples for
58565856
WHEN COUNT({{ lib.render_target_column('analyzed_table') }}) = 0 THEN 0.0
58575857
ELSE 100.0 * SUM(
58585858
CASE
5859-
WHEN LENGTH({{ lib.render_target_column('analyzed_table')}}) > {{(parameters.max_length)}}
5859+
WHEN LENGTH(CAST({{ lib.render_target_column('analyzed_table')}} AS CHAR)) > {{(parameters.max_length)}}
58605860
THEN 1
58615861
ELSE 0
58625862
END
@@ -5876,7 +5876,7 @@ Expand the *Configure with data grouping* section to see additional examples for
58765876
WHEN COUNT(analyzed_table.`target_column`) = 0 THEN 0.0
58775877
ELSE 100.0 * SUM(
58785878
CASE
5879-
WHEN LENGTH(analyzed_table.`target_column`) > 100
5879+
WHEN LENGTH(CAST(analyzed_table.`target_column` AS CHAR)) > 100
58805880
THEN 1
58815881
ELSE 0
58825882
END
@@ -6707,7 +6707,7 @@ spec:
67076707
WHEN COUNT({{ lib.render_target_column('analyzed_table') }}) = 0 THEN 0.0
67086708
ELSE 100.0 * SUM(
67096709
CASE
6710-
WHEN LENGTH({{ lib.render_target_column('analyzed_table')}}) > {{(parameters.max_length)}}
6710+
WHEN LENGTH(CAST({{ lib.render_target_column('analyzed_table')}} AS CHAR)) > {{(parameters.max_length)}}
67116711
THEN 1
67126712
ELSE 0
67136713
END
@@ -6728,7 +6728,7 @@ spec:
67286728
WHEN COUNT(analyzed_table.`target_column`) = 0 THEN 0.0
67296729
ELSE 100.0 * SUM(
67306730
CASE
6731-
WHEN LENGTH(analyzed_table.`target_column`) > 100
6731+
WHEN LENGTH(CAST(analyzed_table.`target_column` AS CHAR)) > 100
67326732
THEN 1
67336733
ELSE 0
67346734
END
@@ -7467,7 +7467,7 @@ Expand the *Configure with data grouping* section to see additional examples for
74677467
WHEN COUNT({{ lib.render_target_column('analyzed_table') }}) = 0 THEN 0.0
74687468
ELSE 100.0 * SUM(
74697469
CASE
7470-
WHEN LENGTH({{ lib.render_target_column('analyzed_table')}}) > {{(parameters.max_length)}}
7470+
WHEN LENGTH(CAST({{ lib.render_target_column('analyzed_table')}} AS CHAR)) > {{(parameters.max_length)}}
74717471
THEN 1
74727472
ELSE 0
74737473
END
@@ -7487,7 +7487,7 @@ Expand the *Configure with data grouping* section to see additional examples for
74877487
WHEN COUNT(analyzed_table.`target_column`) = 0 THEN 0.0
74887488
ELSE 100.0 * SUM(
74897489
CASE
7490-
WHEN LENGTH(analyzed_table.`target_column`) > 100
7490+
WHEN LENGTH(CAST(analyzed_table.`target_column` AS CHAR)) > 100
74917491
THEN 1
74927492
ELSE 0
74937493
END

0 commit comments

Comments
 (0)