Skip to content

Commit

Permalink
Update devices and sites schema
Browse files Browse the repository at this point in the history
  • Loading branch information
NicholasTurner23 committed Dec 12, 2024
1 parent 2d11ffb commit 93fcf00
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/workflows/airqo_etl_utils/meta_data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ def extract_devices_from_api(tenant: Tenant = Tenant.ALL) -> pd.DataFrame:
dataframe = pd.json_normalize(devices)
dataframe = dataframe[
[
"tenant",
"network",
"latitude",
"longitude",
Expand All @@ -25,8 +24,6 @@ def extract_devices_from_api(tenant: Tenant = Tenant.ALL) -> pd.DataFrame:
"description",
"device_manufacturer",
"device_category",
"approximate_latitude",
"approximate_longitude",
]
]

Expand Down Expand Up @@ -124,7 +121,7 @@ def extract_sites_from_api(network: str = "all") -> pd.DataFrame:
dataframe = pd.json_normalize(sites)
dataframe = dataframe[
[
"tenant",
"network",
"site_id",
"latitude",
"longitude",
Expand Down
5 changes: 5 additions & 0 deletions src/workflows/airqo_etl_utils/schema/devices.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,10 @@
"name": "device_category",
"type": "STRING",
"mode": "NULLABLE"
},
{
"name": "last_updated",
"type": "TIMESTAMP",
"mode": "NULLABLE"
}
]
12 changes: 11 additions & 1 deletion src/workflows/airqo_etl_utils/schema/sites.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"type": "STRING",
"mode": "REQUIRED"
},
{
"name": "network",
"type": "STRING",
"mode": "REQUIRED"
},
{
"name": "id",
"type": "STRING",
Expand Down Expand Up @@ -68,5 +73,10 @@
"name": "city",
"type": "STRING",
"mode": "NULLABLE"
},
{
"name": "last_updated",
"type": "DATE",
"mode": "NULLABLE"
}
]
]

0 comments on commit 93fcf00

Please sign in to comment.