Skip to content

Commit

Permalink
fix list comprehension in ga metrics and add default region
Browse files Browse the repository at this point in the history
  • Loading branch information
btylerburton committed Jul 22, 2024
1 parent aaff3fb commit 33a70a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-metrics-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v3
- uses: actions/cache@v4
name: Define a cache for the virtual environment based on the dependencies lock file
with:
path: ./.venv
Expand All @@ -55,5 +55,6 @@ jobs:
env:
AWS_ACCESS_KEY_ID_METRICS: ${{ secrets.AWS_ACCESS_KEY_ID_METRICS }}
AWS_SECRET_ACCESS_KEY_METRICS: ${{ secrets.AWS_SECRET_ACCESS_KEY_METRICS }}
AWS_DEFAULT_REGION: us-gov-west-1
run: |
poetry run python datagov_metrics
11 changes: 3 additions & 8 deletions metrics/datagov_metrics/ga.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,10 @@ def write_data_to_csv(response):
if response.get("rows"):
writer.writerows(
[
*[
[val["value"] for val in row.get("dimensionValues") or []]
for row in response["rows"]
],
*[
[val["value"] for val in row["metricValues"]]
for row in response["rows"]
],
*[val["value"] for val in row.get("dimensionValues") or []],
*[val["value"] for val in row["metricValues"]],
]
for row in response["rows"]
)
return csv_buffer.getvalue()

Expand Down

0 comments on commit 33a70a1

Please sign in to comment.