Skip to content

Commit 222c33d

Browse files
committed
add dob_jobapplications ingest template
1 parent f8ba343 commit 222c33d

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

dcpy/library/templates/dob_jobapplications.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# migrated to ingest
12
dataset:
23
name: dob_jobapplications
34
acl: public-read
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
id: dob_jobapplications
2+
acl: public-read
3+
4+
attributes:
5+
name: The Department of Buildings (DOB) Job Application Filings
6+
description: |
7+
This dataset contains all job applications submitted through the Borough Offices,
8+
through eFiling, or through the HUB, which have a "Latest Action Date" since January 1, 2000.
9+
This dataset does not include jobs submitted through DOB NOW. See the DOB NOW: Build - Job Application Filings dataset for DOB NOW jobs.
10+
url: https://data.cityofnewyork.us/d/ic3t-wcy2
11+
12+
ingestion:
13+
source:
14+
type: socrata
15+
org: nyc
16+
uid: ic3t-wcy2
17+
format: csv
18+
file_format:
19+
type: csv
20+
dtype: str
21+
processing_steps:
22+
- name: clean_column_names
23+
args: {"replace": {"_": ""}, "lower": True}

products/developments/sql/_bis.sql

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,13 @@ OUTPUTS:
6666

6767
DROP TABLE IF EXISTS _init_bis_devdb;
6868

69-
WITH applications AS (SELECT * FROM dob_jobapplications),
69+
WITH applications AS (
70+
SELECT
71+
*,
72+
ROW_NUMBER() OVER(PARTITION BY jobnumber ORDER BY SUBSTR(dobrundate, 7, 4)||SUBSTR(dobrundate, 1, 2)||SUBSTR(dobrundate, 4, 2) DESC) as gid,
73+
SUBSTR(dobrundate, 7, 4)||SUBSTR(dobrundate, 1, 2)||SUBSTR(dobrundate, 4, 2) as dobrundate
74+
FROM dob_jobapplications
75+
),
7076

7177
parking_spaces AS (SELECT * FROM dob_jobapplications_parkingspaces),
7278

0 commit comments

Comments
 (0)