-
Notifications
You must be signed in to change notification settings - Fork 6
Allow supplemental API data to be passed to ColdfrontFetchProcessor #282
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| - project: | ||
| pi: pi4@harvard.edu | ||
| attributes: | ||
| Allocated Project ID: P4-supplement | ||
| Allocated Project Name: P4-supplement-name | ||
| resource: | ||
| name: shift |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| import os | ||
| import json | ||
| from pathlib import Path | ||
| import pandas as pd | ||
| import pytest | ||
|
|
@@ -112,7 +113,14 @@ def _prepare_pipeline_execution( | |
| # Environment setup for subprocess execution | ||
| env = os.environ.copy() | ||
| env["INVOICE_MONTH"] = INVOICE_MONTH | ||
| env["COLDFRONT_API_FILEPATH"] = str(test_files["test_coldfront_api_data.json"]) | ||
|
|
||
| # pydantic_settings parses complex types as JSON-encoded strings: https://pydantic.dev/docs/validation/latest/concepts/pydantic_settings/#parsing-environment-variable-values | ||
| env["COLDFRONT_API_FILEPATHS"] = json.dumps( | ||
| ( | ||
| str(test_files["test_coldfront_api_data.json"]), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the file parsing code, you actually only call
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When I saw the e2e test pass, I realized json_data = '{"name": "Alice", "age": 30, "city": "New York"}'
parsed_data = yaml.safe_load(json_data)
# parsed_data is {'name': 'Alice', 'age': 30, 'city': 'New York'} |
||
| str(test_files["test_supplement_api_data.yaml"]), | ||
| ) | ||
| ) | ||
| env["FETCH_FROM_S3"] = "false" | ||
| env["UPLOAD_TO_S3"] = "false" | ||
| env["invoice_path_template"] = str(test_files["test_invoice_dir"]) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This now introduces the possibility of an Allocated Project ID being matched to several instances in the ColdFront data. Can you please write a test that documents the behavior in such a scenario?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From 2:30 discussion today, I'll keep the behavior as error out and write the test for it