populate_parent_packages

Function populate_parent_packages 

Source
pub fn populate_parent_packages(
    resources: &mut BTreeMap<String, PrePackagedResource>,
) -> Result<()>
Expand description

Fill in missing data on parent packages.

When resources are added, their parent packages could be missing data. If we simply materialized the child resources without the parents, Python’s importer would get confused due to the missing resources.

This function fills in the blanks in our resources state.

The way this works is that if a child resource has data in a particular field, we populate that field in all its parent packages. If a corresponding fields is already populated, we copy its data as well.