Skip to content

Conversation

risafangs
Copy link
Contributor

@risafangs risafangs commented Nov 20, 2024

What

  • Add new int model that doesn’t filter out non-presidential candidates and tracks committee (not individual) contributions to Congressional candidates

Output

-- select * limit 10
┌───────────┬──────────────────────┬──────────────────────┬───┬────────────────┬─────────┬─────────────────┐
│  CAND_ID  │      CAND_NAME       │ CAND_PTY_AFFILIATION │ … │ TRANSACTION_TP │  STATE  │ TRANSACTION_AMT │
│  varchar  │       varchar        │       varchar        │   │    varchar     │ varchar │  decimal(14,2)  │
├───────────┼──────────────────────┼──────────────────────┼───┼────────────────┼─────────┼─────────────────┤
│ S2TX00312 │ CRUZ, RAFAEL EDWAR…  │ REP                  │ … │ 24K            │ TX      │          -20.00 │
│ S4WI00256 │ HOVDE, ERIC          │ REP                  │ … │ 24K            │ WI      │           -1.00 │
│ H8TX06266 │ ELLZEY, JOHN KEVIN…  │ REP                  │ … │ 24K            │ TX      │           -5.00 │
│ S8MO00160 │ HAWLEY, JOSHUA DAV…  │ REP                  │ … │ 24K            │ MO      │           -5.00 │
│ H2IN02295 │ YAKYM, RUDY C. III   │ REP                  │ … │ 24K            │ VA      │          -30.00 │
│ H4CO03423 │ VARELA, STEPHEN A    │ REP                  │ … │ 24K            │ CO      │            0.00 │
│ H2AZ01354 │ CRANE, ELI           │ REP                  │ … │ 24K            │ AZ      │          -28.00 │
│ S8FL00273 │ SCOTT, RICK SEN      │ REP                  │ … │ 24K            │ FL      │           -4.00 │
│ H2AZ01354 │ CRANE, ELI           │ REP                  │ … │ 24K            │ AZ      │           -9.00 │
│ H8PA15195 │ MACKENZIE, RYAN ED…  │ REP                  │ … │ 24K            │ PA      │           -1.00 │
├───────────┴──────────────────────┴──────────────────────┴───┴────────────────┴─────────┴─────────────────┤
│ 10 rows                                                                             14 columns (6 shown) │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────┘

Why

  • Joining the contributions to all candidates (or Congressional candidates) enables analysis of races other than the presidential race, would be interesting to see what states or what other races were most contentious, and whether they were all in swing states, etc.
    • To extend, would be fun to explore in Evidence to look at most expensive races for House vs Senate vs overall, most active Committees(?), states where money is coming from vs going?

For discussion

  • Is it actually necessary to filter out presidential races into their own intermediate model, or could this data be combined in one intermediate model and then filtered downstream (if needed)?
  • Did not make a marts model yet. Would help to have some input on what end state of marts models should look like?

@risafangs risafangs marked this pull request as ready for review November 20, 2024 05:05
@even-wei even-wei mentioned this pull request Nov 25, 2024
@even-wei
Copy link
Contributor

Hi @risafangs
Can you help me to git rebase main and commit again?
I want to make the CI work.

@risafangs risafangs force-pushed the feature/congress-int-models branch from cdf7826 to 0c5f913 Compare December 5, 2024 18:25
Copy link

github-actions bot commented Dec 5, 2024

Recce Summary

Manifest Information

Manifest Catalog
Base 2024-12-05 18:26:04 2024-12-05 18:26:04
Current 2024-12-05 18:26:18 2024-12-05 18:26:18

Lineage Graph

No changed module was detected.

Checks Summary

Checks Run Data Mismatch Detected
2 0

See PR page: https://cloud.datarecce.io/DataRecce/TodoFEC-dbt/pulls/24

Next Steps

To view detailed Recce results:

  1. Checkout the PR branch: git checkout feature/congress-int-models
  2. Launch the Recce server: recce server --review --cloud
  3. Open http://localhost:8000 in your browser

@risafangs
Copy link
Contributor Author

@even-wei Sorry for the delay! Looks like CI worked, not sure how to read the Cloud output.

@even-wei
Copy link
Contributor

even-wei commented Dec 6, 2024

Hi @risafangs

Thanks for making the CI work!
Also, I found I didn't finish the configuration for Recce Cloud yet. 😅

However, you can try Recce locally, here is the steps.
And I'm going to finish the configuration.

@even-wei
Copy link
Contributor

even-wei commented Dec 9, 2024

Hi @risafangs

Sorry for the late reply, I have finished the configuration for Recce Cloud.

Re the discussion part:

  1. Is it actually necessary to filter out presidential races into their own intermediate model, or could this data be combined in one intermediate model and then filtered downstream (if needed)?
  2. Did not make a marts model yet. Would help to have some input on what end state of marts models should look like?

I think those two questions came to the same end. What do we want to know.
The original goal is to focus on the analysis of presidential candidates.
Is there any other questions you would want to know from those data we have?

@risafangs
Copy link
Contributor Author

Hi @even-wei! I was able to get the recce server up to see the changes in UI based on the instructions you shared, which was super cool. The recce server --review --cloud command fails for me, though:

[Error] Failed to load recce state file
Reason: No GitHub token is provided to access the pull request information.

I do have a recce_state.json file in my project.

On the modeling piece - I personally think it would be preferable to have a generic model that includes contributions to all types of candidates and filter on Presidential/House/Senate/etc in the analytical/reporting models. This way the same model could be used as the base to answer any questions around contribution types, like which races were the most expensive, are PACs more active in presidential vs congressional race, etc. Most of the original questions in the repo/doc don’t segment on the type of race.

@even-wei
Copy link
Contributor

Hi @risafangs, sorry for the late reply. To use recce server --review --cloud, you have to create a Github token for it and configure the environment variables:

export GITHUB_TOKEN=<your_github_token>
export RECCE_STATE_PASSWORD=recce-todofec-dbt

But I think it's fine as you can see the local version already.

Regarding the modeling, I like the idea. Would you like to create issues for each of your proposal. Then I can merge this PR, and we can move to one of the races.

@even-wei even-wei merged commit 5a8b2a6 into DataRecce:main Dec 30, 2024
1 of 2 checks passed
@risafangs risafangs deleted the feature/congress-int-models branch December 30, 2024 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants