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

Fix upload icbc #964

Merged
merged 8 commits into from
Dec 7, 2021
23 changes: 11 additions & 12 deletions backend/api/services/icbc_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,17 @@ def ingest_icbc_spreadsheet(excelfile, requesting_user, dateCurrentTo):

df.query('MODEL_YEAR > 2018', inplace=True)
# df = df[(df.MODEL_YEAR > 2018)]
df.query('MODEL_YEAR > 2018', inplace=True)
df.query('HYBRID_VEHICLE_FLAG != "N"', inplace=True)
df.query('ELECTRIC_VEHICLE_FLAG != "N"', inplace=True)
df['FUEL_TYPE'] = df['FUEL_TYPE'].str.upper()
df.query('FUEL_TYPE in ["ELECTRIC", "HYDROGEN", "GASOLINEELECTRIC"]')
# df = df[
# (df.HYBRID_VEHICLE_FLAG != 'N') |
# (df.ELECTRIC_VEHICLE_FLAG != 'N') |
# (df.FUEL_TYPE.str.upper() == 'ELECTRIC') |
# (df.FUEL_TYPE.str.upper() == 'HYDROGEN') |
# (df.FUEL_TYPE.str.upper() == 'GASOLINEELECTRIC')
# ]
# df.query('HYBRID_VEHICLE_FLAG != "N"', inplace=True)
# df.query('ELECTRIC_VEHICLE_FLAG != "N"', inplace=True)
# df['FUEL_TYPE'] = df['FUEL_TYPE'].str.upper()
# df.query('FUEL_TYPE in ["ELECTRIC", "HYDROGEN", "GASOLINEELECTRIC"]')
df = df[
(df.HYBRID_VEHICLE_FLAG != 'N') |
(df.ELECTRIC_VEHICLE_FLAG != 'N') |
(df.FUEL_TYPE.str.upper() == 'ELECTRIC') |
(df.FUEL_TYPE.str.upper() == 'HYDROGEN') |
(df.FUEL_TYPE.str.upper() == 'GASOLINEELECTRIC')
]
df.query('VIN != 0')
# df = df[(df.VIN != 0)]

Expand Down