Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gun Violence Front-end Integration (Gen Pop Adults) #2915

Closed
wants to merge 4 commits into from

Conversation

kccrtv
Copy link
Collaborator

@kccrtv kccrtv commented Feb 15, 2024

Copy link

netlify bot commented Feb 15, 2024

Deploy Preview for health-equity-tracker ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 8a6964e
🔍 Latest deploy log https://app.netlify.com/sites/health-equity-tracker/deploys/65de0687e418d00008c84f61
😎 Deploy Preview https://deploy-preview-2915--health-equity-tracker.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

'gun_violence_suicide_pct_relative_inequity',
'gun_violence_injuries_pct_relative_inequity',
]
const GUN_VIOLENCE_DETERMINANTS = [...GUN_VIOLENCE_METRICS]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these shouldn't be the same. determinants should be like "injuries, homicides, suicides" and metrics should be x_per_100k x_pct_share etc

metricQuery.dataTypeId,
timeView
)
if (!datasetId) throw Error('DatasetId undefined')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is getting thrown

super('gun_violence_provider', GUN_VIOLENCE_DETERMINANTS)
}

getDatasetId(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something in the arguments sent in to this method are not triggering any of the if conditions so it's returning undefined

@benhammondmusic
Copy link
Collaborator

@kccrtv make sure in the PR description you literally write closes #123456 for the actual issues and then it'll automatically close them. right now it's just referencing them but merging this PR wont close those issues unless you do it manually

@kccrtv kccrtv reopened this Feb 27, 2024
benhammondmusic and others added 3 commits February 27, 2024 09:22
# Description and Motivation
<!--- bulleted, high level items. use keywords (eg "closes SatcherInstitute#144" or
"fixes #4323") -->

Related to SatcherInstitute#2911 

By extending the existing `write_to_bq` method, we can keep our existing
tests in place, and allow the BQ flow to continue uninterupted, but now
optionally redirect the written table to local frontend instead of BQ.
NOTE: Eventually we'll likely want to rename this method across the
entire codebase including the `data_server` to something like
`run_pipeline()`

## Pipeline

- removes deprecated table name methods from the parent DataSource class
- adds a `local_pipeline_utils.py` file to hold new utility functions
that will help us run our pipelines locally, including reading real data
directly from the `/data` dir, and writing json files to
frontend/public/tmp folder (to allow local loading)
- adds a new python file that instantiates the class (and can easily
extend to iterate over all data sources, and the calls the write to bq
with the "write to local frontend" flag enabled. NOTE: this is still
making real calls out to BQ for population data and FIPS data, etc. We
should consider re-structuring this, so that here and also for our
tests, instead of having to mock, our data sources could just read from
the data directory like `data/acs_population/` or `data/state_ids` or
similar

## `CDCVaccinationNational`

- adjusts `CDCVaccinationNational.write_to_bq()` to accept an optional
boolean keyword arg
- adjusts `CDCVaccinationNational.write_to_bq()` so if that flag is
passed, it uses the util from above to write to frontend instead of
writing to bigquery


## Has this been tested? How?

- working locally, it writes out json files as expected to the
`/frontend/public/tmp` folder
- by adding the file names into the .env file and restarting the
localhost server it automatically serves those tables instead of reading
from the backend


## Types of changes

(leave all that apply)

- Refactor / chore

## New frontend preview link is below in the Netlify comment 😎
Bullet points and indentation in news articles enhance readability and
organization. They highlight key information, making it easier for
readers to identify main points and follow the structure of the content.

tests passing

![Screenshot 2024-02-27 at 9 09
46 AM](https://github.com/SatcherInstitute/health-equity-tracker/assets/67879386/0d5803b7-6d33-40d9-b8f8-883ebd5a8f5e)

- refactor?

---------

Co-authored-by: Eric M Warren II <eric.m.warren1@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants