Skip to content

Commit 576f7a1

Browse files
committed
string formatting fixes
1 parent e7e6a71 commit 576f7a1

7 files changed

+26
-28
lines changed

products/cscl/models/log_files/log__lion_centerline_or_proto_seglocstatus_mismatch.sql

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,24 @@ joined AS (
1414
lion.segmentid,
1515
lion.segment_locational_status,
1616
CASE
17-
WHEN lion.source_feature_layer = 'centerline' THEN centerline.seglocstatus
18-
WHEN lion.source_feature_layer = 'altsegmentdata' THEN proto.seglocstatus
17+
WHEN lion.source_table = 'centerline' THEN centerline.seglocstatus
18+
WHEN lion.source_table = 'altsegmentdata' THEN proto.seglocstatus
1919
END AS source_segment_locational_status,
20-
lion.source_feature_layer
20+
lion.source_table
2121
FROM lion
22-
LEFT JOIN centerline ON lion.source_feature_layer = 'centerline' AND lion.segmentid = centerline.segmentid
23-
LEFT JOIN proto ON lion.source_feature_layer = 'altsegmentdata' AND lion.globalid = proto.globalid
24-
WHERE lion.source_feature_layer IN ('centerline', 'altsegmentdata')
22+
LEFT JOIN centerline ON lion.source_table = 'centerline' AND lion.segmentid = centerline.segmentid
23+
LEFT JOIN proto ON lion.source_table = 'altsegmentdata' AND lion.globalid = proto.globalid
24+
WHERE lion.source_table IN ('centerline', 'altsegmentdata')
2525
)
2626
SELECT
2727
'seglocstatus mismatch' As error_category,
2828
globalid,
29-
source_feature_layer,
29+
source_table AS source_feature_layer,
3030
'segmentid' AS record_id_type,
3131
segmentid AS record_id,
3232
FORMAT(
33-
'Segment from feature layer % with globalid % has calculated seglocstatus % and source field seglocstatus %',
34-
source_feature_layer,
33+
'Segment from feature layer %s with globalid %s has calculated seglocstatus %s and source field seglocstatus %s',
34+
source_table,
3535
globalid,
3636
segment_locational_status,
3737
source_segment_locational_status
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
SELECT
22
'protosegment without geometry-modeled segment' As error_category,
33
globalid,
4-
source_feature_layer,
4+
source_table AS source_feature_layer,
55
'segmentid' AS record_id_type,
6-
segmentid AS record_id,
7-
FORMAT(
8-
'Protosegment with globalid % and segmentid % has no corresponding geometry-modeled segment.',
9-
globalid,
10-
segmentid
11-
) AS message
6+
segmentid AS record_id
127
FROM {{ ref('int__protosegments') }}
138
WHERE geom IS NULL

products/cscl/models/log_files/log__lion_segments_ap_boro_mismatch.sql

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,20 @@ aps AS (
77
SELECT
88
'neither joined atomic polygon matches segment''s borocode' As error_category,
99
segments.globalid,
10-
segments.source_feature_layer,
10+
segments.source_table AS source_feature_layer,
1111
'segmentid' AS record_id_type,
1212
segments.segmentid AS record_id,
1313
FORMAT(
14-
'Segment from feature layer % with globalid % has boro %, '
15-
|| 'left atomic polygon boro % and right atomic polygon boro %',
16-
source_feature_layer,
17-
globalid,
18-
segment_borocode,
19-
left_borocode,
20-
right_borocode
14+
'Segment from feature layer %s with globalid %s has boro %s, '
15+
|| 'left atomic polygon with atomicid "%s" has boro "%s", '
16+
|| 'and right atomic polygon with atomicid "%s" has boro "%s".',
17+
segments.source_table,
18+
segments.globalid,
19+
aps.segment_borocode,
20+
aps.left_atomicid,
21+
aps.left_borocode,
22+
aps.right_atomicid,
23+
aps.right_borocode
2124
) AS message
2225
FROM aps
2326
INNER JOIN segments ON aps.globalid = segments.globalid

products/cscl/models/log_files/log__lion_segments_missing_aps.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
SELECT
22
'segment joined to no atomic polygon' As error_category,
33
globalid,
4-
source_feature_layer,
4+
source_table AS source_feature_layer,
55
'segmentid' AS record_id_type,
66
segmentid AS record_id,
77
'' AS message

products/cscl/models/log_files/log__lion_segments_missing_facecode.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ WITH segments AS (
1010
SELECT DISTINCT
1111
'missing facecode' As error_category,
1212
globalid,
13-
source_feature_layer,
13+
source_table AS source_feature_layer,
1414
'segmentid' AS record_id_type,
1515
segmentid AS record_id,
1616
'' AS message

products/cscl/models/log_files/log__lion_segments_missing_nodes.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
SELECT
22
'segment missing node' As error_category,
33
globalid,
4-
source_feature_layer,
4+
source_table AS source_feature_layer,
55
'segmentid' AS record_id_type,
66
segmentid AS record_id,
77
'' AS message

products/cscl/models/log_files/log__lion_segments_missing_nypd.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ nypd AS (
77
SELECT
88
'segment joined to no nypd beat' As error_category,
99
segments.globalid,
10-
segments.source_feature_layer,
10+
segments.source_table AS source_feature_layer,
1111
'segmentid' AS record_id_type,
1212
segments.segmentid AS record_id,
1313
'' AS message

0 commit comments

Comments
 (0)