Commit 7e6eed2a authored by Bruno Duyé's avatar Bruno Duyé

Fix convert errors due to empty data

parent a4ba185c
......@@ -256,7 +256,8 @@ def iter_series(table_filepath):
def iter_observations(observations_list):
for observation_dict in observations_list:
yield (get_period(observation_dict), norm_value(observation_dict["Valor"]))
if observation_dict:
yield (get_period(observation_dict), norm_value(observation_dict["Valor"]))
def get_dimensions_values_and_labels(series_dict):
def get_in_with_assert(metadata_dict, metadata_path, assertions=True):
......@@ -294,6 +295,9 @@ def iter_series(table_filepath):
table_json = json.load(table_file)
for series_json in table_json:
log.debug("series {!r}".format(series_json['COD']))
if not series_json['Data']:
# empty series
dimensions_values, dimensions_labels = get_dimensions_values_and_labels(series_json)
yield {
'name': series_json["Nombre"].strip(),
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment