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

Guard our BigQuery release metadata sync against upcoming schema changes #16956

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/unit/packaging/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,8 @@ def test_update_release_description(db_request):
SchemaField("maintainer", "STRING", "NULLABLE"),
SchemaField("maintainer_email", "STRING", "NULLABLE"),
SchemaField("license", "STRING", "NULLABLE"),
SchemaField("license_expression", "STRING", "NULLABLE"),
SchemaField("license_files", "STRING", "REPEATED"),
SchemaField("keywords", "STRING", "NULLABLE"),
SchemaField("classifiers", "STRING", "REPEATED"),
SchemaField("platform", "STRING", "REPEATED"),
Expand Down Expand Up @@ -624,6 +626,8 @@ def find_service(name=None):
"maintainer_email": form_factory["maintainer_email"].data
or None,
"license": form_factory["license"].data or None,
"license_expression": None,
"license_files": [],
miketheman marked this conversation as resolved.
Show resolved Hide resolved
"keywords": form_factory["description_content_type"].data
or None,
"classifiers": form_factory["classifiers"].data or [],
Expand Down Expand Up @@ -774,6 +778,8 @@ def find_service(name=None):
"maintainer": release.maintainer or None,
"maintainer_email": release.maintainer_email or None,
"license": release.license or None,
"license_expression": None,
"license_files": [],
"keywords": release.keywords or None,
"classifiers": release.classifiers or [],
"platform": [release.platform] or [],
Expand Down
2 changes: 1 addition & 1 deletion warehouse/packaging/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def update_bigquery_release_files(task, request, dist_metadata):
# values individually
json_rows = dict()
for sch in table_schema:
field_data = dist_metadata[sch.name]
field_data = dist_metadata.get(sch.name, None)

if isinstance(field_data, datetime.datetime):
field_data = field_data.isoformat()
Expand Down