Select to view content in your preferred language

arcgis.features.analysis import join_features error

233
1
07-19-2024 08:48 AM
Labels (1)
Nsml12
by
New Contributor

My code (below) worked before, costing 10 credits and created a new feature layer.

# retrieves feature layer  with a layer and table
itemid=xyzxyzxyzxyzxyz
item= gis.content.get(itemid)
layer = item.layers[0] 
table =item.tables[0] 

#dictionary to match by 'Location ID' attribute
attribute_relationship = [{"targetField": "Location_ID", "joinField": "Location_ID"}]


#Create new feature layer with joined layer and table
join_output = join_features(target_layer=layer,
join_layer=table,
attribute_relationship=attribute_relationship,
join_operation='JoinOneToMany',
output_name=strftime('Results%m_%d_%Y')
)

print("Join operation completed. Output item ID:", join_output.id)

However, it now runs with an error code when no changes has been made. How to I go about the error and what does it mean? The error message is below:

Failed to serve the request against portals/self/isServiceNameAvailable due to Error code: 400
Description: Bad syntax in request.
Message: Unsupported service type: {0}.
.
{"messageCode": "AO_100215", "message": "JoinFeatures failed."}
Failed to execute (JoinFeatures).
Failed.
0 Kudos
1 Reply
David_McRitchie
Esri Contributor

Hey,

I tried giving this a go and repeated the workflow a few times. Agreed I do not see any coding issues with this.

I suspect something within the data has changed, particularly if the error is stating that the service type is unsupported. Can we therefore confirm if both the layer and table have been reuploaded or overwritten by any other processes?

Hope that helps,

David

Esri UK -Technical Support Analyst
0 Kudos