From 1c67ac45a45083094b6d9a61c9c4b4992922f2fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alessandro=20Pezz=C3=A8?= Date: Sat, 25 Jul 2020 21:18:10 +0200 Subject: [PATCH] feat: allow null values in pokemon.csv --- data/v2/build.py | 12 ++++++------ data/v2/csv/pokemon.csv | 3 +++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/data/v2/build.py b/data/v2/build.py index 4ac95214..64f613a4 100644 --- a/data/v2/build.py +++ b/data/v2/build.py @@ -1336,12 +1336,12 @@ def _build_pokemons(): yield Pokemon( id=int(info[0]), name=info[1], - pokemon_species_id=int(info[2]), - height=int(info[3]), - weight=int(info[4]), - base_experience=int(info[5]), - order=int(info[6]), - is_default=bool(int(info[7])), + pokemon_species_id=int(info[2]) if info[2] != "" else None, + height=int(info[3]) if info[3] != "" else None, + weight=int(info[4]) if info[4] != "" else None, + base_experience=int(info[5]) if info[5] != "" else None, + order=int(info[6]) if info[6] != "" else None, + is_default=bool(int(info[7])) if info[7] != "" else None, ) build_generic((Pokemon,), "pokemon.csv", csv_record_to_objects) diff --git a/data/v2/csv/pokemon.csv b/data/v2/csv/pokemon.csv index 7dd67ef5..c1f93541 100644 --- a/data/v2/csv/pokemon.csv +++ b/data/v2/csv/pokemon.csv @@ -887,6 +887,9 @@ id,identifier,species_id,height,weight,base_experience,order,is_default 888,zacian,888,28,1100,335,,1 889,zamazenta,889,29,2100,335,,1 890,eternatus,890,200,9500,345,,1 +891,kubfu,891,6,120,,,1 +892,urshifu,892,19,1050,,,1 +893,zarude,893,18,700,,,1 10001,deoxys-attack,386,17,608,270,497,0 10002,deoxys-defense,386,17,608,270,498,0 10003,deoxys-speed,386,17,608,270,499,0