AnsweredAssumed Answered

Updating connection info via python from SDE to File geodb - with a feature dataset

Question asked by fsheagle-co-nz-esridist Employee on Jan 30, 2019
Latest reply on Aug 11, 2020 by jmoulds-esristaff

Hi,

I'm clipping data and moving to a file geodb from SDE and fixing up datasources  for a symbolised Pro project before publishing.

This works for the main part unless the feature class is in a feature dataset. Doing the below works for 90% of my feature classes - if the FC is in a FD the source breaks as Pro can't find the FD in the filegeodb. (note the validate false was for troubleshooting)

 

con_props = {'connection_info':{'database': temp_filegeodb,
                                'authentication_mode': '',
                                'dbclient': '',
                                'db_connection_properties': '',
                                'password': '',
                                'instance': '',
                                'server': '',
                                'user': '',
                                'version': ''},
             'dataset': name,
             'workspace_factory': 'File Geodatabase',
             'feature_dataset': ''
             }
print(con_props)
a_layer.updateConnectionProperties(a_layer.connectionProperties, con_props,validate=False)

yet I can't see a flag to clear the feature dataset from the layer.

So we end up with a broken datasource as the layer is still looking for the original feature dataset. Is there an easy way to clear this - I haven't seen anything in the doco.

 

Before:

After:

 

surely this property is exposed in the connection_info dictionary? Right?

Ta

Fraser

Outcomes