Skip to content

Commit 7d25e65

Browse files
committed
add message field to logs
1 parent c98aca2 commit 7d25e65

7 files changed

+32
-7
lines changed

products/cscl/models/log_files/log__lion_centerline_or_proto_seglocstatus_mismatch.sql

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ SELECT
2828
globalid,
2929
source_table,
3030
'segmentid' AS record_id_type,
31-
segmentid AS record_id
31+
segmentid AS record_id,
32+
FORMAT(
33+
'Segment from feature layer % with globalid % has calculated seglocstatus % and source field seglocstatus %',
34+
source_table,
35+
globalid,
36+
segment_locational_status,
37+
source_segment_locational_status
38+
) AS message
3239
FROM joined
3340
WHERE segment_locational_status IS DISTINCT FROM source_segment_locational_status

products/cscl/models/log_files/log__lion_protosegment_orphans.sql

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ SELECT
33
globalid,
44
source_table,
55
'segmentid' AS record_id_type,
6-
segmentid AS record_id
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
712
FROM {{ ref('int__protosegments') }}
813
WHERE geom IS NULL

products/cscl/models/log_files/log__lion_segments_ap_boro_mismatch.sql

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,16 @@ SELECT
99
segments.globalid,
1010
segments.source_table,
1111
'segmentid' AS record_id_type,
12-
segments.segmentid AS record_id
12+
segments.segmentid AS record_id,
13+
FORMAT(
14+
'Segment from feature layer % with globalid % has boro %, '
15+
|| 'left atomic polygon boro % and right atomic polygon boro %',
16+
source_table,
17+
globalid,
18+
segment_borocode,
19+
left_borocode,
20+
right_borocode
21+
) AS message
1322
FROM aps
1423
INNER JOIN segments ON aps.lionkey = segments.lionkey
1524
WHERE

products/cscl/models/log_files/log__lion_segments_missing_aps.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ SELECT
33
globalid,
44
source_table,
55
'segmentid' AS record_id_type,
6-
segmentid AS record_id
6+
segmentid AS record_id,
7+
'' AS message
78
FROM {{ ref('int__lion') }}
89
WHERE left_atomicid IS NULL AND right_atomicid IS NULL

products/cscl/models/log_files/log__lion_segments_missing_facecode.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ SELECT DISTINCT
1212
globalid,
1313
source_table,
1414
'segmentid' AS record_id_type,
15-
segmentid AS record_id
15+
segmentid AS record_id,
16+
'' AS message
1617
FROM segments
1718
WHERE face_code IS NULL

products/cscl/models/log_files/log__lion_segments_missing_nodes.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ SELECT
33
globalid,
44
source_table,
55
'segmentid' AS record_id_type,
6-
segmentid AS record_id
6+
segmentid AS record_id,
7+
'' AS message
78
FROM {{ ref('int__lion') }}
89
WHERE from_nodeid IS NULL OR to_nodeid IS NULL

products/cscl/models/log_files/log__lion_segments_missing_nypd.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ SELECT
33
globalid,
44
source_table,
55
'segmentid' AS record_id_type,
6-
segmentid AS record_id
6+
segmentid AS record_id,
7+
'' AS message
78
FROM {{ ref('int__lion') }}
89
WHERE left_nypd_service_area IS NULL AND right_nypd_service_area IS NULL

0 commit comments

Comments
 (0)