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

feat: Make most fields in big query diagnostic schema as optional #404 #420

Merged
merged 1 commit into from
Aug 1, 2022
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
20 changes: 10 additions & 10 deletions bigquery/diag_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,37 @@
"type": "STRING"
},
{
"mode": "REQUIRED",
"mode": "NULLABLE",
"name": "BN",
"type": "STRING"
},
{
"mode": "REQUIRED",
"mode": "NULLABLE",
"name": "ID",
"type": "STRING"
},
{
"mode": "REQUIRED",
"mode": "NULLABLE",
"name": "BA",
"type": "STRING"
},
{
"mode": "REQUIRED",
"mode": "NULLABLE",
"name": "FR",
"type": "STRING"
},
{
"mode": "REQUIRED",
"mode": "NULLABLE",
"name": "FW",
"type": "STRING"
},
{
"mode": "REQUIRED",
"mode": "NULLABLE",
"name": "VA",
"type": "STRING"
},
{
"mode": "REQUIRED",
"mode": "NULLABLE",
"name": "serial_number",
"type": "STRING"
},
Expand All @@ -65,17 +65,17 @@
"type": "BOOLEAN"
},
{
"mode": "REQUIRED",
"mode": "NULLABLE",
"name": "PK",
"type": "STRING"
},
{
"mode": "REQUIRED",
"mode": "NULLABLE",
"name": "OK",
"type": "STRING"
},
{
"mode": "REQUIRED",
"mode": "NULLABLE",
"name": "AN",
"type": "STRING"
},
Expand Down
20 changes: 10 additions & 10 deletions hw_diag/diagnostics/bigquery_data_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ class DiagnosticDataModel(BaseModel):
last_updated: str
E0: Optional[str]
W0: Optional[str]
BN: str
ID: str
BA: str
FR: str
FW: str
VA: str
serial_number: str
BN: Optional[str]
ID: Optional[str]
BA: Optional[str]
FR: Optional[str]
FW: Optional[str]
VA: Optional[str]
serial_number: Optional[str]
ECC: Optional[bool]
LOR: Optional[bool]
PK: str
OK: str
AN: str
PK: Optional[str]
OK: Optional[str]
AN: Optional[str]
MC: Optional[bool]
MD: Optional[bool]
MH: Optional[int]
Expand Down
2 changes: 1 addition & 1 deletion hw_diag/tests/test_gcs_shipper.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_diagnostics_missing_required_field(self, mock_requests):
mock_requests.post = MagicMock()
mock_requests.post.return_value = OKResponse()
diag_data = valid_diagnostic_data().copy()
diag_data.pop('serial_number')
diag_data.pop('last_updated')
retval = upload_diagnostics(diag_data, True)
self.assertFalse(retval)

Expand Down