Skip to content

Commit

Permalink
#1035: Changing from dict pop to assigning to None
Browse files Browse the repository at this point in the history
  • Loading branch information
philipjyoon committed Dec 10, 2024
1 parent baba41a commit 74a8371
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions product2dataset/product2dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,18 +272,18 @@ def convert(

# Get rid of bunch of data that we don't care about but takes up a lot of space
logger.info("dataset_met_json[run_config].keys() = " + str(dataset_met_json["runconfig"].keys()))
dataset_met_json["runconfig"].pop("localize")# This list is the same as lineage so no point in duplicatingq
dataset_met_json["runconfig"]["input_file_group"].pop("input_file_paths") # This list is the same as lineage so no point in duplicating
dataset_met_json["runconfig"]["localize"] = None# This list is the same as lineage so no point in duplicatingq
dataset_met_json["runconfig"]["input_file_group"]["input_file_paths"] = None # This list is the same as lineage so no point in duplicating

# "accountability" is added elsewhere in the code so we can't delete it here
# dataset_met_json["accountability"]["L3_DISP_S1"]["inputs"] = _DELETED_TEXT # We don't consume this at all

for file in dataset_met_json["Files"]:
logger.info("Files keys: "+ str(file.keys()))
logger.info("Removing runconfig and lineage from each file")
file.pop("lineage") # Lineage for the entire product is already at metadata level so no point in duplicating for each file
file["runconfig"].pop("localize") # this is superfulous
file["runconfig"]["input_file_group"].pop("input_file_paths") # this is superfulous
file["lineage"] = None # Lineage for the entire product is already at metadata level so no point in duplicating for each file
file["runconfig"]["localize"] = None # this is superfulous
file["runconfig"]["input_file_group"]["input_file_paths"] = None # this is superfulous

logger.info("Reducing lineage string size by truncating basepath of lineage entries")
if len(dataset_met_json["lineage"]) > 0:
Expand Down

0 comments on commit 74a8371

Please sign in to comment.