Skip to content

Commit

Permalink
add new fields to dob_safety_violations (#336)
Browse files Browse the repository at this point in the history
Addresses issue #329, adding new fields to the yaml and test data
  • Loading branch information
cmhac committed May 29, 2024
1 parent 8718f69 commit 640fd7c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
7 changes: 7 additions & 0 deletions src/nycdb/datasets/dob_safety_violations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,12 @@ schema:
state: text
zip: text
bbl: char(10)
postcode: text
latitude: double precision
longitude: double precision
communityboard: text
councildistrict: text
censustract2020: text
neighborhoodtabulationareanta2020: text
sql:
- dob_safety_violations.sql
16 changes: 10 additions & 6 deletions src/tests/integration/data/dob_safety_violations.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
BIN,Violation Issue Date,Violation Number,Violation Type,Violation Remarks,Violation Status,Device Number,Device Type,Cycle End Date,Borough,Block,Lot,House Number,Street,City,State,Zip
4438381,06/01/2016,060116EJVCAT500419,E,,Active,4P5577,Elevator,,MANHATTAN,8401,6,249-14 A,GRAND CENTRAL PARKWAY,New York,New York,11426
4438381,10/03/2017,100317EACJ100203,E,,Active,4P5577,Elevator,,MANHATTAN,8401,6,249-14 A,GRAND CENTRAL PARKWAY,New York,New York,11426
3001729,12/17/2021,121721EEVCAT500708,E,,Active,3P14612,Elevator,,MANHATTAN,234,1,23,PIERREPONT STREET,New York,New York,11201
3119942,06/20/2023,062023LBLVIO40932,LBLVIO,VIOLATION ISSUED-FAILURE TO FILE 2019 EXTERNAL LOW PRESSURE INSPECTION,Active,30000072606N0001,Boiler,,BROOKLYN,5193,0,1173,ROGERS AVENUE,New York,New York,11226
3336806,04/25/2023,042523LBLVIO14451,LBLVIO,VIOLATION ISSUED - FAILURE TO FILE 2022 EXTERNAL LOW PRESSURE INSPECTION,Active,30000097526N0001,Boiler,,BROOKLYN,638,0,64,20 STREET,New York,New York,11232
BIN,Violation Issue Date,Violation Number,Violation Type,Violation Remarks,Violation Status,Device Number,Device Type,Cycle End Date,Borough,Block,Lot,House Number,Street,City,State,Postcode,Latitude,Longitude,Community Board,Council District,BBL,Census Tract (2020),Neighborhood Tabulation Area (NTA) (2020)
3116942,01/06/2006,010606LL629112840,LL6291,,Active,30000070181Y0001,Boiler,12/31/2005,Brooklyn,5091,7,803,ROGERS AVENUE,New York,New York,11226,40.651182,-73.952513,317,40,3050910007,820,East Flatbush-Erasmus
4233155,03/01/2013,030113LBLVIO15727,LBLVIO,VIOLATION ISSUED FOR FAILURE TO FILE ANNUAL BOILER 2011 INSPECTION REPORT,Active,40000054750N0001,Boiler,11/15/2011,Queens,10898,2,198-03,HOLLIS AVENUE,New York,New York,11412,40.706401,-73.759408,412,27,4108980002,506,Hollis
3205018,06/20/2023,062023LBLVIO39206,LBLVIO,VIOLATION ISSUED-FAILURE TO FILE 2019 EXTERNAL LOW PRESSURE INSPECTION,Active,30000041009Y0001,Boiler,12/31/2019,Brooklyn,7463,49,1801,VOORHIES AVENUE,New York,New York,11235,40.58605,-73.950924,315,48,3074630049,600,Sheepshead Bay-Manhattan Beach-Gerritsen Beach
4238340,01/06/2006,010606LL629122660,LL6291,,Active,40000074513N0001,Boiler,12/31/2005,Queens,11066,1,194-15,LINDEN BOULEVARD,New York,New York,11412,40.693003,-73.757516,412,27,4110660001,528,St. Albans
2021170,06/20/2023,062023LBLVIO31057,LBLVIO,VIOLATION ISSUED-FAILURE TO FILE 2019 EXTERNAL LOW PRESSURE INSPECTION,Active,20000164250N0001,Boiler,12/31/2019,Bronx,3510,29,486,HOWE AVENUE,New York,New York,10473,40.816277,-73.848467,209,18,2035100029,84,Castle Hill-Unionport
2047876,11/08/2019,110819LBLVIO03726,LBLVIO,VIOLATION ISSUED FOR FAILURE TO FILE ANNUAL BOILER 2017 INSPECTION REPORT,Active,20000011757Y0001,Boiler,12/31/2017,Bronx,4256,14,1980,UNIONPORT ROAD,New York,New York,10462,40.850287,-73.868588,211,13,2042560014,230,Pelham Parkway-Van Nest
1087701,10/23/2023,VIO-FTC-VT-CAT1-202112-0004936,FTC-VT-CAT1-CO,Violation Issued-Failure To File 2021 Cat1 Test Affirmation of Correction,Active,1E20710,Elevator,12/31/2021,Manhattan,793,7507,605,6 AVENUE,New York,New York,10011,40.739609,-73.995211,104,3,1007937507,81,Chelsea-Hudson Yards
2056241,10/01/2015,100115LBLVIO04018,LBLVIO,VIOLATION ISSUED FOR FAILURE TO FILE ANNUAL BOILER 2014 INSPECTION REPORT,Active,20000064145N0001,Boiler,12/31/2014,Bronx,4596,15,3234,WHITE PLAINS ROAD,New York,New York,10467,40.872136,-73.867123,212,12,2045960015,374,Williamsbridge-Olinville
1081110,10/23/2023,VIO-FTC-VT-CAT1-202212-0008409,FTC-VT-CAT1-HA,Violation Issued-Failure To File 2022 Cat1 Test Affirmation of Correction,Dismissed,1P22202,Elevator,12/31/2022,Manhattan,1757,1,2175,5 AVENUE,New York,New York,10037,40.81125,-73.938718,111,9,1017570001,210,East Harlem (North)
2 changes: 1 addition & 1 deletion src/tests/integration/test_nycdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ def test_dob_safety_violations(conn):
drop_table(conn, 'dob_safety_violations')
dob_safety_violations = nycdb.Dataset('dob_safety_violations', args=ARGS)
dob_safety_violations.db_import()
assert row_count(conn, 'dob_safety_violations') == 5
assert row_count(conn, 'dob_safety_violations') == 9


def test_shapefile_in_alt_schema_works(conn):
Expand Down

0 comments on commit 640fd7c

Please sign in to comment.