Skip to content

Commit

Permalink
Map DP types for the correct value
Browse files Browse the repository at this point in the history
It seems that the API sends a "type" value that is not accepted for the
bulk upsert method.
The error message and the API documentation are different.
  • Loading branch information
drscholly committed Jan 15, 2024
1 parent 620ec6f commit 1b29403
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions toolbox/commands/copy_dataprocessings.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ def copy_dataprocessings(url_source: str,
for output in item['outputs']:
output_index = item['outputs'].index(output)
items[item_index]['outputs'][output_index]['entityPath'] = output['path']
# there is a problem with dpi types, we must map them to the correct value (accepted by the API)
if item['type'] == "Search":
items[item_index]['type'] = "Lookup"
if item['type'] == "ConstantVariable":
items[item_index]['type'] = "Variable"
if item['type'] == "Calculation":
items[item_index]['type'] = "AnalyticalCalculation"
source_dataprocessings[dp_index]['dataProcessingItems'] = items

# copy the dataprocessings on the target workspace
Expand Down

0 comments on commit 1b29403

Please sign in to comment.