@@ -769,42 +769,9 @@ def get_entity_provenance(id):
769769 # Normalize the raw provenance nodes based on the yaml schema
770770 normalized_provenance_dict = {
771771 'relationships' : raw_provenance_dict ['relationships' ],
772- 'nodes' : [ ]
772+ 'nodes' : raw_provenance_dict [ 'nodes' ]
773773 }
774774
775- for node_dict in raw_provenance_dict ['nodes' ]:
776- # The schema yaml doesn't handle Lab nodes, just leave it as is
777- if (node_dict ['label' ] == 'Entity' ) and (node_dict ['entity_type' ] != 'Lab' ):
778- # Generate trigger data
779- # Skip some of the properties that are time-consuming to generate via triggers:
780- # director_ancestor for Sample, and direct_ancestors for Dataset
781- # Also skip next_revision_uuid and previous_revision_uuid for Dataset to avoid additional
782- # checks when the target Dataset is public but the revisions are not public
783- properties_to_skip = [
784- 'direct_ancestors' ,
785- 'direct_ancestor' ,
786- 'next_revision_uuid' ,
787- 'previous_revision_uuid'
788- ]
789-
790- # We'll need to return all the properties (except the ones to skip from above list)
791- # including those generated by `on_read_trigger` to have a complete result
792- # The 'on_read_trigger' doesn't really need a token
793- complete_entity_dict = schema_manager .get_complete_entity_result (token , node_dict , properties_to_skip )
794-
795- # Filter out properties not defined or not to be exposed in the schema yaml
796- normalized_entity_dict = schema_manager .normalize_entity_result_for_response (complete_entity_dict )
797-
798- # Now the node to be used by provenance is all regulated by the schema
799- normalized_provenance_dict ['nodes' ].append (normalized_entity_dict )
800- elif node_dict ['label' ] == 'Activity' :
801- # Normalize Activity nodes too
802- normalized_activity_dict = schema_manager .normalize_activity_result_for_response (node_dict )
803- normalized_provenance_dict ['nodes' ].append (normalized_activity_dict )
804- else :
805- # Skip Entity Lab nodes
806- normalized_provenance_dict ['nodes' ].append (node_dict )
807-
808775 provenance_json = provenance .get_provenance_history (uuid , normalized_provenance_dict , auth_helper_instance )
809776
810777 # Response with the provenance details
0 commit comments