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

Update extract-chicago-permits workflow to query Athena and output Excel workbooks #13

17 changes: 10 additions & 7 deletions .github/workflows/extract-chicago-permits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,28 +61,31 @@ jobs:
shell: bash
working-directory: ${{ env.WORKING_DIR }}

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_IAM_ROLE_TO_ASSUME_ARN }}
aws-region: us-east-1

- name: Extract permits
run: pipenv run python3 permit_cleaning.py
shell: bash
working-directory: ${{ env.WORKING_DIR }}
env:
AWS_REGION: us-east-1
AWS_ATHENA_S3_STAGING_DIR: s3://ccao-athena-results-us-east-1/

- name: Compress permit directories into one file
id: compress-permits
run: |
ZIP_FILENAME="chicago-permits-$(date +%Y%m%d%H%M%S).zip"
mkdir chicago-permits
mv csvs_for_* chicago-permits/
mv files_for_* chicago-permits/
zip -r "$ZIP_FILENAME" chicago-permits
echo "filename=$ZIP_FILENAME" >> "$GITHUB_OUTPUT"
shell: bash
working-directory: ${{ env.WORKING_DIR }}

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_IAM_ROLE_TO_ASSUME_ARN }}
aws-region: us-east-1

- name: Upload compressed permit file to S3
id: s3-upload
run: |
Expand Down
2 changes: 2 additions & 0 deletions chicago/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ name = "pypi"
requests = "2.31.*"
pandas = "2.1.*"
sodapy = "2.2.*"
PyAthena = "3.0.*"
XlsxWriter = "3.1.*"

[dev-packages]

Expand Down
142 changes: 103 additions & 39 deletions chicago/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading