Skip to content

Commit

Permalink
Merge branch 'master' into add-workflow-to-gen-data
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenglimEar committed Nov 1, 2023
2 parents 3e11a12 + 1822274 commit b883c21
Show file tree
Hide file tree
Showing 8 changed files with 252 additions and 29 deletions.
22 changes: 22 additions & 0 deletions bin/fix-pending
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
# Usage: ./bin/fix-pending [database name] [table name]
# ./bin/fix-pending disclosure-backend A-Contributions
set -euo pipefail

if [ $# -ne 2 ]; then
echo 'Usage: ./bin/fix-pending [database name] [table name]'
exit 1
fi

database_name=$1
table_name=$2

cat <<-QUERY | psql ${database_name}
\\set ON_ERROR_STOP on
UPDATE "$table_name" t SET "Filer_ID" = "FPPC"
from candidates
WHERE lower(t."Filer_ID"::varchar(9)) = 'pending'
AND t."Filer_NamL" = "Committee_Name"
AND has_pending;
QUERY
3 changes: 3 additions & 0 deletions bin/import-file
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ if ls $filename_glob 2>/dev/null >/dev/null; then
csvsql --db postgresql:///$DATABASE_NAME --tables $table_name --insert ${table_exists:+--no-create}
echo -n ' Removing empty Tran_Date... '
./bin/clean "$DATABASE_NAME" "$table_name"
echo
echo -n ' Fixing pending Filer_IDs... '
./bin/fix-pending "$DATABASE_NAME" "$table_name"
else
echo 'Found no files to import'
fi
23 changes: 15 additions & 8 deletions build/_data/candidates/oakland/2023-11-07/jorge-c-lerma.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,27 @@
"is_winner": null,
"filer_id": 1463520,
"supporting_money": {
"contributions_received": 0.0,
"total_contributions": 0.0,
"total_expenditures": null,
"total_loans_received": null,
"contributions_received": 5885.0,
"total_contributions": 5885.0,
"total_expenditures": 678.1,
"total_loans_received": 0.0,
"total_supporting_independent": 0.0,
"support_list": [

],
"contributions_by_type": {
"Individual": 5600.0,
"Unitemized": 285.0
},
"contributions_by_origin": {
"Out of State": 1200.0,
"Within Oakland": 3500.0,
"Within California": 900.0
},
"total_small_contributions": null,
"total_small_contributions": 285.0,
"expenditures_by_type": {
"Polling and Survey Research": 195.0,
"Information Technology Costs (Internet, E-mail)": 444.75
},
"supporting_by_type": {
}
Expand All @@ -47,7 +54,7 @@

]
},
"total_contributions": 0.0,
"total_expenditures": null,
"total_loans_received": null
"total_contributions": 5885.0,
"total_expenditures": 678.1,
"total_loans_received": 0.0
}
8 changes: 4 additions & 4 deletions build/_data/committees/1421001.json
Original file line number Diff line number Diff line change
Expand Up @@ -1500,24 +1500,24 @@
{
"Filer_ID": "1421001",
"Tran_Emp": "Jordan Custom Builders",
"Tran_Occ": "Owner",
"Tran_Occ": "Operations Manager",
"Entity_Cd": "Individual",
"Tran_Amt1": 200.0,
"Tran_Date": "2020-07-21",
"Tran_NamF": "Billy",
"Tran_NamL": "Jordan",
"Tran_Zip4": "75204"
"Tran_Zip4": "75154"
},
{
"Filer_ID": "1421001",
"Tran_Emp": "Jordan Custom Builders",
"Tran_Occ": "Operations Manager",
"Tran_Occ": "Owner",
"Entity_Cd": "Individual",
"Tran_Amt1": 200.0,
"Tran_Date": "2020-07-21",
"Tran_NamF": "Billy",
"Tran_NamL": "Jordan",
"Tran_Zip4": "75154"
"Tran_Zip4": "75204"
},
{
"Filer_ID": "1421001",
Expand Down
179 changes: 177 additions & 2 deletions build/_data/committees/1463520.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,181 @@
{
"total_contributions": 0,
"total_contributions": 5600.0,
"contributions": [

{
"Filer_ID": "1463520",
"Tran_Emp": "Oakland Unified schools",
"Tran_Occ": "Administrator as needed",
"Entity_Cd": "Individual",
"Tran_Amt1": 100.0,
"Tran_Date": "2023-10-04",
"Tran_NamF": "Maureen",
"Tran_NamL": "Hartney",
"Tran_Zip4": "94602"
},
{
"Filer_ID": "1463520",
"Tran_Emp": "Salesforce",
"Tran_Occ": "Decision Scientist",
"Entity_Cd": "Individual",
"Tran_Amt1": 100.0,
"Tran_Date": "2023-10-04",
"Tran_NamF": "Brandon",
"Tran_NamL": "Wall",
"Tran_Zip4": "94602-1146"
},
{
"Filer_ID": "1463520",
"Tran_Emp": "Rogers Family Foundation",
"Tran_Occ": "NONPROFIT",
"Entity_Cd": "Individual",
"Tran_Amt1": 100.0,
"Tran_Date": "2023-10-05",
"Tran_NamF": "Sara",
"Tran_NamL": "Levine",
"Tran_Zip4": "94610"
},
{
"Filer_ID": "1463520",
"Tran_Emp": "Not Employed",
"Tran_Occ": "Not Employed",
"Entity_Cd": "Individual",
"Tran_Amt1": 100.0,
"Tran_Date": "2023-10-06",
"Tran_NamF": "Steven",
"Tran_NamL": "Fajardo",
"Tran_Zip4": "94608"
},
{
"Filer_ID": "1463520",
"Tran_Emp": "Momentive",
"Tran_Occ": "Lawyer",
"Entity_Cd": "Individual",
"Tran_Amt1": 100.0,
"Tran_Date": "2023-10-06",
"Tran_NamF": "Nina",
"Tran_NamL": "Senn",
"Tran_Zip4": "94611"
},
{
"Filer_ID": "1463520",
"Tran_Emp": "Donahue Fitzgerald LLP",
"Tran_Occ": "Attorney",
"Entity_Cd": "Individual",
"Tran_Amt1": 100.0,
"Tran_Date": "2023-10-06",
"Tran_NamF": "David",
"Tran_NamL": "Stein",
"Tran_Zip4": "94501"
},
{
"Filer_ID": "1463520",
"Tran_Emp": "City of Oakland",
"Tran_Occ": "Policy Analyst",
"Entity_Cd": "Individual",
"Tran_Amt1": 100.0,
"Tran_Date": "2023-10-07",
"Tran_NamF": "Caleb",
"Tran_NamL": "Smith",
"Tran_Zip4": "94610"
},
{
"Filer_ID": "1463520",
"Tran_Emp": "Self Employed",
"Tran_Occ": "Handyman",
"Entity_Cd": "Individual",
"Tran_Amt1": 600.0,
"Tran_Date": "2023-10-10",
"Tran_NamF": "Ricky",
"Tran_NamL": "Cantu",
"Tran_Zip4": "77339"
},
{
"Filer_ID": "1463520",
"Tran_Emp": "Self Employed",
"Tran_Occ": "Self Employed",
"Entity_Cd": "Individual",
"Tran_Amt1": 600.0,
"Tran_Date": "2023-10-10",
"Tran_NamF": "Emmanuel",
"Tran_NamL": "Gomez",
"Tran_Zip4": "94601"
},
{
"Filer_ID": "1463520",
"Tran_Emp": "Retired",
"Tran_Occ": "Retired",
"Entity_Cd": "Individual",
"Tran_Amt1": 600.0,
"Tran_Date": "2023-10-10",
"Tran_NamF": "Onaida",
"Tran_NamL": "Lerma",
"Tran_Zip4": "94602"
},
{
"Filer_ID": "1463520",
"Tran_Emp": "Self Employed",
"Tran_Occ": "Self Employed",
"Entity_Cd": "Individual",
"Tran_Amt1": 600.0,
"Tran_Date": "2023-10-10",
"Tran_NamF": "Jose",
"Tran_NamL": "Robledo",
"Tran_Zip4": "89122"
},
{
"Filer_ID": "1463520",
"Tran_Emp": "Self Employed",
"Tran_Occ": "student",
"Entity_Cd": "Individual",
"Tran_Amt1": 600.0,
"Tran_Date": "2023-10-10",
"Tran_NamF": "Maassa",
"Tran_NamL": "Zamora",
"Tran_Zip4": "94601"
},
{
"Filer_ID": "1463520",
"Tran_Emp": "Oakland Unified Public Schools",
"Tran_Occ": "Education District Leader",
"Entity_Cd": "Individual",
"Tran_Amt1": 200.0,
"Tran_Date": "2023-10-11",
"Tran_NamF": "Leroy",
"Tran_NamL": "Gaines",
"Tran_Zip4": "94518"
},
{
"Filer_ID": "1463520",
"Tran_Emp": "La Clinica de la Raza",
"Tran_Occ": "Nurse Practitioner",
"Entity_Cd": "Individual",
"Tran_Amt1": 600.0,
"Tran_Date": "2023-10-16",
"Tran_NamF": "Maria",
"Tran_NamL": "Massella",
"Tran_Zip4": "94606"
},
{
"Filer_ID": "1463520",
"Tran_Emp": "HP Investors LLC",
"Tran_Occ": "Finance",
"Entity_Cd": "Individual",
"Tran_Amt1": 600.0,
"Tran_Date": "2023-10-17",
"Tran_NamF": "Isaac",
"Tran_NamL": "Abid",
"Tran_Zip4": "94611"
},
{
"Filer_ID": "1463520",
"Tran_Emp": "RCR Inc.",
"Tran_Occ": "Business Owner",
"Entity_Cd": "Individual",
"Tran_Amt1": 500.0,
"Tran_Date": "2023-10-20",
"Tran_NamF": "Blanca",
"Tran_NamL": "Perez",
"Tran_Zip4": "94542"
}
]
}
22 changes: 15 additions & 7 deletions build/_data/elections/oakland/2023-11-07.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"total_contributions": 17530.0,
"total_contributions": 23415.0,
"total_contributions_by_source": {
"Out of State": 100.0,
"Within Oakland": 8896.0,
"Within California": 6976.0
"Out of State": 1300.0,
"Within Oakland": 12396.0,
"Within California": 7876.0
},
"contributions_by_type": {
"Committee": 6000.0,
"Individual": 9972.0,
"Unitemized": 1558.0
"Individual": 15572.0,
"Unitemized": 1843.0
},
"most_expensive_races": [
{
"slug": "school-board-district-5",
"type": "office",
"title": "School Board District 5",
"amount": 17530.0
"amount": 23415.0
}
],
"largest_small_proportion": [
Expand All @@ -26,6 +26,14 @@
"candidate": "Alexandra Ritzie-Hernandez",
"proportion": 0.0966343411294923,
"office_title": "School Board District 5"
},
{
"slug": "jorge-c-lerma",
"type": "office",
"title": "Oakland November 7th, 2023 Special Election",
"candidate": "Jorge C. Lerma",
"proportion": 0.048428207306711976,
"office_title": "School Board District 5"
}
],
"largest_independent_expenditures": [
Expand Down
22 changes: 15 additions & 7 deletions build/_data/totals.json
Original file line number Diff line number Diff line change
Expand Up @@ -1312,23 +1312,23 @@
]
},
"oakland-2023": {
"total_contributions": 17530.0,
"total_contributions": 23415.0,
"total_contributions_by_source": {
"Out of State": 100.0,
"Within Oakland": 8896.0,
"Within California": 6976.0
"Out of State": 1300.0,
"Within Oakland": 12396.0,
"Within California": 7876.0
},
"contributions_by_type": {
"Committee": 6000.0,
"Individual": 9972.0,
"Unitemized": 1558.0
"Individual": 15572.0,
"Unitemized": 1843.0
},
"most_expensive_races": [
{
"slug": "school-board-district-5",
"type": "office",
"title": "School Board District 5",
"amount": 17530.0
"amount": 23415.0
}
],
"largest_small_proportion": [
Expand All @@ -1339,6 +1339,14 @@
"candidate": "Alexandra Ritzie-Hernandez",
"proportion": 0.0966343411294923,
"office_title": "School Board District 5"
},
{
"slug": "jorge-c-lerma",
"type": "office",
"title": "Oakland November 7th, 2023 Special Election",
"candidate": "Jorge C. Lerma",
"proportion": 0.048428207306711976,
"office_title": "School Board District 5"
}
],
"largest_independent_expenditures": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
election: _elections/oakland/2023-11-07.md
candidates:
- alexandra-ritzie-hernandez
- christian-miguel-martinez
- jorge-c-lerma
- christian-miguel-martinez
title: School Board District 5
label: Oakland Unified School District
---

0 comments on commit b883c21

Please sign in to comment.