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

Updated chart data, S3 aggregate parquet moved #124

Merged
merged 3 commits into from
Oct 15, 2024

Conversation

dogversioning
Copy link
Contributor

  • Moves the /chart_data/ endpoint to /data_packages/[data_package_id]/chart
  • chart data now accessed via id instead of name
  • updated S3 storage and glue crawlers to use data_package_id
  • migration for existing aggregates
  • added specific error handling for files not found in S3
  • some import cleanup

Copy link

github-actions bot commented Oct 15, 2024

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
685 664 97% 90% 🟢

New Files

File Coverage Status
src/handlers/shared/errors.py 100% 🟢
TOTAL 100% 🟢

Modified Files

File Coverage Status
src/handlers/dashboard/get_chart_data.py 95% 🟢
src/handlers/dashboard/get_data_packages.py 100% 🟢
src/handlers/site_upload/powerset_merge.py 97% 🟢
TOTAL 97% 🟢

updated for commit: 5e92e4f by action🐍

docs/dashboard_api.prod.yaml Outdated Show resolved Hide resolved
@@ -580,12 +577,23 @@ paths:
content: {}
security:
- api_key: []
/study-periods:
/data_packages/{data_package_id}:
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this is so lonely at the end, separated from its child API

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is autogenerated from API gateway, I have no control over it.

scripts/migrations/migration.004.s3_name_with_id.py Outdated Show resolved Hide resolved
src/handlers/dashboard/get_chart_data.py Outdated Show resolved Hide resolved
res = functions.http_response(200, res)
except errors.AggregatorS3Error:
res = functions.http_response(
404, f"Aggregate for {path_params['data_package_id']} not found"
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: that's a very specific conclusion to draw from a generic "something happened error". Might be helpful to log the original error message and/or include it here too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The error should get logged to cloudwatch, security asked us to have no stack traces in responses and to generally have these error messages be unhelpful while the API is externally accessible.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add a comment to that effect? Like... if a third developer comes across this in 2 years, they won't have that context. Something like "# don't be too informative about internal state in our error messages" (but in Matt voice) above this generic response.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, added a brief note.

src/handlers/site_upload/powerset_merge.py Outdated Show resolved Hide resolved
tests/site_upload/test_powerset_merge.py Outdated Show resolved Hide resolved
tests/site_upload/test_powerset_merge.py Outdated Show resolved Hide resolved
@dogversioning dogversioning merged commit fce0d93 into main Oct 15, 2024
2 checks passed
@dogversioning dogversioning deleted the mg/chart_data_update branch October 15, 2024 15:42
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