Skip to content

Commit

Permalink
Metadata: only transform relation types if they are present
Browse files Browse the repository at this point in the history
  • Loading branch information
lwesterhof committed Nov 16, 2023
1 parent 6cda601 commit 69bcecf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion schema_transformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ def _default2_default3(ctx, m):
resources = []
for resource in m['Related_Datapackage']:
# Only use the identifier regarding relation type
resource['Relation_Type'] = resource['Relation_Type'].split(':')[0]
if resource.get('Relation_Type', False):
resource['Relation_Type'] = resource['Relation_Type'].split(':')[0]
resources.append(resource)
m['Related_Resource'] = resources
m.pop('Related_Datapackage')
Expand Down

0 comments on commit 69bcecf

Please sign in to comment.