When using ArcPy with the ArcMap (10.4.1) architecture I am able to set a variable to a feature class and make a feature layer from it using the code below:
rock_unit_table = "Database Connections\\TEST PROD [personal].sde\\Test.TEST.DETAILED_SURFACE_COMP"
arcpy.MakeFeatureLayer_management(rock_unit_table, "rockUnit_lyr")
but when I try to do something analogous using ArcPy with ArcGIS Pro 1.3.1:
rock_unit_table = r"Databases\TEST PROD [personal]\Test.TEST.DETAILED_SURFACE_COMP"
arcpy.MakeFeatureLayer_management(rock_unit_table, "rockUnit_lyr")
I get an error (with some anonymizing applied):
Traceback (most recent call last): File "N:\path\Test.py", line 324, in arcpy.MakeFeatureLayer_management(rock_unit_table, "rockUnit_lyr") File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 5607, in MakeFeatureLayer raise e File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 5604, in MakeFeatureLayer retval = convertArcObjectToPythonObject(gp.MakeFeatureLayer_management(*gp_fixargs((in_features, out_layer, where_clause, workspace, field_info), True))) File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing_base.py", line 506, in return lambda *args: val(*gp_fixargs(args, True)) arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Input Features: Dataset Databases\TEST PROD [personal]\Test.TEST.DETAILED_SURFACE_COMP does not exist or is not supported Failed to execute (MakeFeatureLayer).
In ArcGIS Pro I can see the feature class under Databases in the Project pane so I think it is my syntax in ArcPy that is astray.
Can anybody suggest what may be astray with the syntax that I am trying to use?