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

Reporting endpoint for biggest offenders #128

Merged
merged 2 commits into from
Dec 14, 2019
Merged

Reporting endpoint for biggest offenders #128

merged 2 commits into from
Dec 14, 2019

Conversation

sellnat77
Copy link
Member

I converted the pandas operations to a sql query instead
Im assuming

sql = "SELECT * \
               FROM ingest_staging_table \
               WHERE CreatedDate > '{}' \
               AND RequestType = '{}' \
               AND NCName = '{}'"\

is equivalent to

dateFilter = df['CreatedDate'] > startDate
        requestFilter = df['RequestType'] == requestType
        councilFilter = df['NCName'] == councilName
        df = df[dateFilter & requestFilter & councilFilter]

Copy link
Contributor

@ryanmswan ryanmswan left a comment

Choose a reason for hiding this comment

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

Yup. Should be right. I need to amend the staging table import to go to an actual table in the database, so we'll have to change the query to make sure it's robust at some point. The SQL query logic seems right for the purpose.

@sellnat77 sellnat77 merged commit 38bbcfa into dev Dec 14, 2019
@sellnat77 sellnat77 deleted the reporting branch December 28, 2019 19:38
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