Repository: nycdb/nycdb (language: python)

Issue:
add Local Law 44 datasets (includes Article XI)
There is a collection of datasets related to local law 44 reporting on subsidized properties, and this includes Article XI which is helpful when trying to capture all subsidized properties in nyc since the furman center's subsidized housing database does not include these (using this for good cause eviction related data projects)

There are a lot of datasets in the collection, and it would be nice to include them all. But I think the most important ones are Building, Projects, and Tax Incentive (for article 11 need to join all 3 to get a list of buildings in the program)

https://data.cityofnewyork.us/browse?Data-Collection_Data-Collection=HPD+Local+Law+44

I don't know if anyone will be interested in all of these, so maybe we can just add as needed? I needed projects and buildings for a project (identifying Article XI properties) so have done those and may add more later but anyone should feel free to take others on at any time, or comment here if you have use for specific ones.

Tables:
- [x] buildings
- [x] projects
- [ ] disqualified list (there are sepecial characters (`’`) in the headers breaking things)
- [ ] rent affordability
- [ ] unit income rent
- [ ] development team
- [ ] wage information
- [ ] other city financial assistance
- [x] tax incentive
- [ ] LIHTC
- [ ] developer selection
- [ ] funding


Discussion / hints:

Fix patch:
diff --git a/src/nycdb/dataset_transformations.py b/src/nycdb/dataset_transformations.py
index 254716b..4faeac2 100644
--- a/src/nycdb/dataset_transformations.py
+++ b/src/nycdb/dataset_transformations.py
@@ -252,3 +252,6 @@ def hpd_ll44_buildings(dataset):
 
 def hpd_ll44_projects(dataset):
     return to_csv(dataset.files[1].dest)
+
+def hpd_ll44_tax_incentive(dataset):
+    return to_csv(dataset.files[2].dest)
diff --git a/src/nycdb/datasets/hpd_ll44.yml b/src/nycdb/datasets/hpd_ll44.yml
index 5045d3a..3ce62f6 100644
--- a/src/nycdb/datasets/hpd_ll44.yml
+++ b/src/nycdb/datasets/hpd_ll44.yml
@@ -7,8 +7,8 @@ files:
     url: https://data.cityofnewyork.us/api/views/ucdy-byxd/rows.csv?accessType=DOWNLOAD
     dest: hpd_ll44_projects.csv
   -
-    url: https://data.cityofnewyork.us/api/views/9s68-zggy/rows.csv?accessType=DOWNLOAD
-    dest: hpd_ll44_disqualified_list.csv
+    url: https://data.cityofnewyork.us/api/views/72vt-ykjc/rows.csv?accessType=DOWNLOAD
+    dest: hpd_ll44_tax_incentive.csv
 sql:
     - hpd_ll44.sql
 schema:
@@ -58,3 +58,10 @@ schema:
       Generalcontractorname: text
       Isdavisbacon: boolean
       Issection220Nyslaborlaw: boolean
+  -
+    table_name: hpd_ll44_tax_incentive
+    fields:
+      Taxincentivedwid: integer
+      Projectid: integer
+      Taxincentivename: text
+      Year1Amount: integer
diff --git a/src/nycdb/sql/hpd_ll44.sql b/src/nycdb/sql/hpd_ll44.sql
index 58861cf..4fe35a3 100644
--- a/src/nycdb/sql/hpd_ll44.sql
+++ b/src/nycdb/sql/hpd_ll44.sql
@@ -3,3 +3,7 @@ CREATE INDEX hpd_ll44_buildings_projectid_idx on hpd_ll44_buildings (projectid);
 CREATE INDEX hpd_ll44_buildings_buildingid_idx on hpd_ll44_buildings (buildingid);
 
 CREATE INDEX hpd_ll44_projects_projectid_idx on hpd_ll44_projects (projectid);
+
+CREATE INDEX hpd_ll44_tax_incentive_projectid_idx on hpd_ll44_tax_incentive (projectid);
+CREATE INDEX hpd_ll44_tax_incentive_taxincentivedwid_idx on hpd_ll44_tax_incentive (taxincentivedwid);
+CREATE INDEX hpd_ll44_tax_incentive_taxincentivename_idx on hpd_ll44_tax_incentive (taxincentivename);


Test patch:
diff --git a/src/tests/integration/data/hpd_ll44_tax_incentive.csv b/src/tests/integration/data/hpd_ll44_tax_incentive.csv
new file mode 100644
index 0000000..a39878d
--- /dev/null
+++ b/src/tests/integration/data/hpd_ll44_tax_incentive.csv
@@ -0,0 +1,6 @@
+TaxIncentiveDWID,ProjectID,TaxIncentiveName,Year1Amount
+5953,44218,Article XI,1076666
+7464,44223,Article XI,70563
+4157,44230,UDAAP,61256
+4164,44258,UDAAP,73574
+4166,44265,UDAAP,1000
diff --git a/src/tests/integration/test_nycdb.py b/src/tests/integration/test_nycdb.py
index f99ec4d..caccfc5 100644
--- a/src/tests/integration/test_nycdb.py
+++ b/src/tests/integration/test_nycdb.py
@@ -883,3 +883,11 @@ def test_hpd_ll44(conn):
         rec = curs.fetchone()
         assert rec is not None
         assert rec['programgroup'] == 'Multifamily Finance Program'
+
+    assert row_count(conn, 'hpd_ll44_tax_incentive') > 0
+    assert has_one_row(conn, "select 1 where to_regclass('public.hpd_ll44_tax_incentive_projectid_idx') is NOT NULL")
+    with conn.cursor(row_factory=dict_row) as curs:
+        curs.execute("select * from hpd_ll44_tax_incentive WHERE projectid = 44218")
+        rec = curs.fetchone()
+        assert rec is not None
+        assert rec['taxincentivename'] == 'Article XI'