Commit f7a9d5cf authored by Bruno Duyé's avatar Bruno Duyé

Fix: dataset codes collision between appendix

parent 74e540c1
Pipeline #3791 failed with stage
in 3 minutes and 23 seconds
......@@ -164,7 +164,8 @@ def treat_dataset(dataset_dict, appendix_path, appendix_dict):
for dimension_code, dimension_value_code in series_dimensions.items()
)
dataset_code = dataset_dict["dataset_code"]
# prefix dataset_code with appendix_code because there's datasets names collisions between appendix
dataset_code = appendix_dict['code'] + '-' + dataset_dict["dataset_code"]
log.debug('- Dataset {!r}'.format(dataset_code))
# Create dataset dir
target_dataset_path = os.path.join(target_dir, dataset_code)
......@@ -180,7 +181,7 @@ def treat_dataset(dataset_dict, appendix_path, appendix_dict):
with open(os.path.join(appendix_path, dataset_source_filename)) as dataset_file:
observations_source_json = json.load(dataset_file)
if not dataset_name:
dataset_name = next(note["NoteText"] for note in observations_source_json["Notes"] if note['NoteRef'] == dataset_code)
dataset_name = next(note["NoteText"] for note in observations_source_json["Notes"] if note['NoteRef'] == dataset_dict["dataset_code"])
# Read each observation and create series files
current_observations_files = {} # Dict of opened observations files indexed by series_codes
for observation_dict in observations_source_json["Data"]:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment