Select to view content in your preferred language

Invalid expression Failed to execute (Select)

215
2
03-11-2025 02:11 PM
Bharat
by
Emerging Contributor

Hi everyone.

I am pretty sure this should be bug but intend to see if someone got the answer to this strange behavior.

So, we have Samples geodatabase that contains the feature class, and we use two set of expression with 

arcpy.analysis.Select to generate two feature classes from the dataset.
Bharat_2-1741727124260.png

 

The expressions when used within ArcGIS Pro (Notebook, geoprocessing tool, definition query) works as intended.

Bharat_0-1741726954642.png

But the same thing started failing since last week as seen from the log file 

Bharat_1-1741727031453.png

Now this the very first function of the script and it has been failing, strangely enough if I am run the whole script from Notebook there are no error 

Bharat_3-1741727340095.png

But it fails, I might try to use other arcpy function which are better suited to create temporary file but need to confirm if the mistake is from my side or its general geoprocessing mess.

TIA

  

0 Kudos
2 Replies
ChrisUnderwood
Esri Regular Contributor

Hello @Bharat , if your script was working but has recently started failing instead, is it possible your data has changed (eg now Project = 'NUN' etc) so other parts of the script are now running that were not before ?

0 Kudos
Bharat
by
Emerging Contributor

Hello @ChrisUnderwood. Thanks for looking at this thread. 

I checked the geodatabase and there seems to be no change in there. The script basically creates temporary feature class, adds new field, populate the new field and then finally delete the feature class in sde and append the data from the temporary feature class to the sde. 
 The other function doesnt even get to run as the failed select function finishes the script.

I mean the sql expression works on definition query, notebook and the sql is valid. We use sql server as our sde so uppercase/lowercase doesnt matter. Have been using python f string so that python doesnt mess up single quote/ double quotes.  

0 Kudos