Select to view content in your preferred language

Python Dissolve Fields ExecuteError

334
1
02-08-2024 05:52 AM
TylerT
by
Frequent Contributor

Hello,

I am running PairwiseDissolve in a script...

 

arcpy.analysis.PairwiseDissolve(fc_1, fc_2, 'cl_id')

 

and get the following error.

TylerT_0-1707399578846.png

I narrowed the issue down to two field names, FolderPath, PopupInfo.  Renaming the fields to folderpath, and popupinfo fixed the problem.  Any ideas why this error occurred and why the fix worked?  Thx.

Tyler
ArcGIS Pro 3.1.0



searchable error:

ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000369: Invalid input field(s)
Failed to execute (PairwiseDissolve).

 

0 Kudos
1 Reply
KimOllivier
Honored Contributor

They look like reserved words in the dropdown data types for parameters to me. Maybe escape them somehow if you have to use them. If you run arcpy.ValidateFieldName() it might prepend underscores if the test finds unacceptable field names. Its a fairly bad bug that these keywords have overflowed into the parameter space.

ValidateFieldName(name, workspace=None)
ValidateFieldName(name, {workspace})

Takes a string (field name) and a workspace path and returns a valid
field name based on name restrictions in the output geodatabase. All
invalid characters in the input string will be replaced with an
underscore (_). The field name restrictions depend on the specific
database used (Structured Query Language [SQL] or Oracle).

name(String):
The field name to be validated. If the optional workspace is not
specified, the field name is validated against the current workspace.

workspace{String}:
An optional specified workspace to validate the field name against. The
workspace can be a file system or a personal, file, or enterprise
geodatabase.

If the workspace is not specified, the field name is validated using the
current workspace environment. If the workspace environment has not been
set, the field name is validated based on a folder workspace.

0 Kudos