Skip to content

Commit

Permalink
Merge pull request #4054 from NicholasTurner23/update-fix/Clean_up
Browse files Browse the repository at this point in the history
Update fix/clean up
  • Loading branch information
Baalmart authored Dec 12, 2024
2 parents 2df1eac + 67f4eb4 commit db819b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
4 changes: 3 additions & 1 deletion src/workflows/airqo_etl_utils/meta_data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
from .constants import Tenant
from .data_validator import DataValidationUtils
from .weather_data_utils import WeatherDataUtils
from datetime import datetime, timezone


class MetaDataUtils:
@staticmethod
def extract_devices_from_api(network: str = "all") -> pd.DataFrame:
def extract_devices_from_api() -> pd.DataFrame:
devices = AirQoApi().get_devices()
dataframe = pd.json_normalize(devices)
dataframe = dataframe[
Expand All @@ -26,6 +27,7 @@ def extract_devices_from_api(network: str = "all") -> pd.DataFrame:
]
]
dataframe["name"] = dataframe["device_id"]
dataframe["last_updated"] = datetime.now(timezone.utc)
dataframe = DataValidationUtils.remove_outliers(dataframe)

return dataframe
Expand Down
15 changes: 0 additions & 15 deletions src/workflows/airqo_etl_utils/schema/devices.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
[
{
"name": "tenant",
"type": "STRING",
"mode": "REQUIRED"
},
{
"name": "network",
"type": "STRING",
Expand All @@ -19,16 +14,6 @@
"type": "FLOAT",
"mode": "NULLABLE"
},
{
"name": "approximate_latitude",
"type": "FLOAT",
"mode": "NULLABLE"
},
{
"name": "approximate_longitude",
"type": "FLOAT",
"mode": "NULLABLE"
},
{
"name": "site_id",
"type": "STRING",
Expand Down

0 comments on commit db819b8

Please sign in to comment.