-
Notifications
You must be signed in to change notification settings - Fork 35
Pass data and country package versions to APIv2 #2501
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
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 |
|---|---|---|
|
|
@@ -158,6 +158,23 @@ def run( | |
| comment = lambda x: set_comment_on_job(x, *identifiers) | ||
| comment("Computing baseline") | ||
|
|
||
| # Get the current dataset version | ||
|
|
||
| version_file = download_huggingface_dataset( | ||
| repo_name=f"policyengine/policyengine-{country_id}-data", | ||
| repo_filename="version.json", | ||
| ) | ||
| with open(version_file, "r") as f: | ||
| version = json.load(f).get("version") | ||
|
|
||
| data_versions = { | ||
|
Collaborator
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. comment, blocking: I think there are some concerns with this approach First, I'd recommend a different approach, perhaps using the code being added as part of https://github.com/PolicyEngine/issues/issues/378 to pull the version number from GCP metadata. Since we're committing to versioning all dataset files at once in a given dataset repo, I think we could just pass a version value as a value associated with a |
||
| dataset.split("/")[-1]: version | ||
| } | ||
|
|
||
| country_package_versions = { | ||
|
Collaborator
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. issue: This duplicates some of what we already have with |
||
| f"policyengine-{country_id}": COUNTRY_PACKAGE_VERSIONS[country_id] | ||
| } | ||
|
|
||
| # If comparing against API v2, start job | ||
| if check_against_api_v2: | ||
|
|
||
|
|
@@ -172,6 +189,8 @@ def run( | |
| "baseline_policy_id": baseline_policy_id, | ||
| "time_period": time_period, | ||
| "dataset": dataset, | ||
| "package_versions": country_package_versions, | ||
|
Collaborator
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. issue, blocking: I believe this will fail a validation check for the |
||
| "data_versions": data_versions, | ||
| "v1_country_package_version": COUNTRY_PACKAGE_VERSIONS[ | ||
| country_id | ||
| ], | ||
|
|
||
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.
question, blocking: I thought we weren't using Hugging Face within the API. I'd expect this information to come from GCP.
Feel free to correct me if I'm wrong. My understanding was that we're keeping the HF code in the
-datapackages,-core, and any non-API packages.