bdit_data-sources
bdit_data-sources copied to clipboard
WYS Schedules API Fails Silently
New stationary signs don't get updated to Open Data because of missing sign schedule (maybe this should be left joined)
https://github.com/CityofToronto/bdit_data-sources/blob/b4cc5dbf4930d5957a87eb2745e16c363412198f/wys/api/sql/open_data/mat-view-stationary-locations.sql#L15-L16
It seems that the issue is that the schedule data from the API doesn't seem to be up to date. For example the two signs on Shuter St. with sign IDs of 33953 and 33956 are supposed to have a schedule of 'School WYSP 30kmh Reg. Operating Schedule' but I can't find their IDs in the output of api.streetsoncloud.com/sv2/signs/schedules .
This affects 94 signs 🤦🏻♂️
SELECT api_id, sign_id, address, sign_name, dir, start_date, serial_num, next_start, prev_start, geom
FROM wys.stationary_signs
LEFT JOIN wys.sign_schedules_list USING (api_id)
WHERE schedule_name IS NULL
Will email vendor
Vendor is working on a fix. Have implemented the LEFT JOIN with the two schedules tables in the stationary summary view.
Will need to review the wys.stationary_summary table with the above signs with missing schedules to see for which months they are missing data.
Vendor emailed to say that the API is fixed.
We re-ran the above query and confirmed there is only 1 sign without a schedule