Select to view content in your preferred language

Validate join gets ValueError: invalid literal for int() with base 10: ''

364
1
11-14-2023 09:57 AM
Ivy_Hinson
Occasional Contributor

I pulled the validate join directly from esri but I keep getting the above error message when I run the script. When I try making the string into a float I get this error: ValueError: could not convert string to float: ''


# Join the feature layer to a table
val_res = arcpy.ValidateJoin_management(inFeatures, joinField, joinTable, joinField)
matched = int(val_res[0])
row_count = int(val_res[1])

print(arcpy.GetMessages())  # Tool messages about the Join

# Validate the join returns matched rows before proceeding
if matched >= 1:
    joined = arcpy.AddJoin_management(inFeatures, joinField, joinTable, joinField)
    # Copy the joined layer to a new permanent feature class
    arcpy.CopyFeatures_management(joined, outFeature)
0 Kudos
1 Reply
DanPatterson
MVP Esteemed Contributor

Code formatting ... the Community Version - Esri Community

line numbers would help

after... val_res =

add ...

print(val_res)

It is apparently returning something that can't be converted to an integer


... sort of retired...
0 Kudos