Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

[Issue: #166] Create ecs task to export opportunity data as csv and json #176

Conversation

Rwolfe-Nava
Copy link

@Rwolfe-Nava Rwolfe-Nava commented Aug 8, 2024

Summary

Fixes #166

Time to review: 20 mins

Changes proposed

  • Adds export_opportunity_data task
  • Changes opportunity_to_csv function to opportunities_to_csv to be more flexible by including output as a parameter
  • Adds unit test for export_opportunity_data task.

Context for reviewers

  • The test runs the export_opportunity_data task, uploading a csv and json file to mock_s3_bucket. Then it reads the files and verifies contents.

@Rwolfe-Nava Rwolfe-Nava changed the title [WIP] Create ecs task to export opportunity data as csv and json [WIP][Issue: 166] Create ecs task to export opportunity data as csv and json Aug 9, 2024
@Rwolfe-Nava Rwolfe-Nava changed the title [WIP][Issue: 166] Create ecs task to export opportunity data as csv and json [WIP][Issue: #166] Create ecs task to export opportunity data as csv and json Aug 9, 2024
@@ -58,7 +58,7 @@ def _process_assistance_listing(assistance_listings: list[dict]) -> str:
)


def opportunity_to_csv(opportunities: Sequence[dict]) -> io.StringIO:
def opportunities_to_csv(opportunities: Sequence[dict], output: io.StringIO) -> None:
Copy link
Author

Choose a reason for hiding this comment

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

Note: I renamed this function with a plural name because I thought it would be slightly more accurate, since it can handle more than one opportunity by taking in a sequence.

@Rwolfe-Nava Rwolfe-Nava changed the title [WIP][Issue: #166] Create ecs task to export opportunity data as csv and json [Issue: #166] Create ecs task to export opportunity data as csv and json Aug 9, 2024
@Rwolfe-Nava Rwolfe-Nava marked this pull request as ready for review August 9, 2024 19:36
@Rwolfe-Nava Rwolfe-Nava requested a review from jamesbursa as a code owner August 9, 2024 19:36
@Rwolfe-Nava Rwolfe-Nava force-pushed the rwolfe-nava/166-create-ecs-task-for-opportunity-data-csv-and-json branch from 9d9a47c to e45969b Compare August 9, 2024 19:36
Copy link
Collaborator

@chouinar chouinar left a comment

Choose a reason for hiding this comment

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

LGTM - just a minor comment suggestion

Co-authored-by: Michael Chouinard <[email protected]>
@chouinar chouinar self-requested a review August 15, 2024 18:48
@Rwolfe-Nava Rwolfe-Nava merged commit 2e0666f into main Aug 15, 2024
8 checks passed
@Rwolfe-Nava Rwolfe-Nava deleted the rwolfe-nava/166-create-ecs-task-for-opportunity-data-csv-and-json branch August 15, 2024 19:10
acouch pushed a commit that referenced this pull request Sep 18, 2024
…son (#176)

Fixes #166

- Adds export_opportunity_data task
- Changes opportunity_to_csv function to opportunities_to_csv to be more
flexible by including output as a parameter
- Adds unit test for export_opportunity_data task.

- The test runs the export_opportunity_data task, uploading a csv and
json file to mock_s3_bucket. Then it reads the files and verifies
contents.

---------

Co-authored-by: Michael Chouinard <[email protected]>
acouch pushed a commit that referenced this pull request Sep 18, 2024
…son (#176)

Fixes #166

- Adds export_opportunity_data task
- Changes opportunity_to_csv function to opportunities_to_csv to be more
flexible by including output as a parameter
- Adds unit test for export_opportunity_data task.

- The test runs the export_opportunity_data task, uploading a csv and
json file to mock_s3_bucket. Then it reads the files and verifies
contents.

---------

Co-authored-by: Michael Chouinard <[email protected]>
acouch pushed a commit to HHS/simpler-grants-gov that referenced this pull request Sep 18, 2024
…son (navapbc#176)

Fixes #166

- Adds export_opportunity_data task
- Changes opportunity_to_csv function to opportunities_to_csv to be more
flexible by including output as a parameter
- Adds unit test for export_opportunity_data task.

- The test runs the export_opportunity_data task, uploading a csv and
json file to mock_s3_bucket. Then it reads the files and verifies
contents.

---------

Co-authored-by: Michael Chouinard <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task]: Create an ECS task that generates CSV and JSON files of our opportunity data
2 participants