Describe the bug
Receiving Error when running ExportReportingData using SDE connection to Oracle Database as user who is not the data owner. Error states that the UN Associations table does not exist in SDE. It is trying to access the table without prefixing the schema name, i.e. [sde connection file path]\UN_5609_Associations instead of [sde connection file path]**[schema name]**.UN_5609_Associations.
ExecuteError Traceback (most recent call last)
File D:\ArcGIS\UtilityDataManagementSupport.atbx\ExportReportingData.tool\tool.script.execute.py:14
File D:\ArcGIS\UtilityDataManagementSupport.atbx\udms\esri.py:557, in gp_wrapper..wrapper(*args, **kwargs)
555 start = time.perf_counter()
556 try:
--> 557 f = func(*args, **kwargs)
558 finally:
559 logger.debug(f"{func.module}.{func.qualname}\t{time.perf_counter() - start}")
File D:\ArcGIS\UtilityDataManagementSupport.atbx\udms\logic_init_.py:604, in reporting_gdb(datasets, output_workspace, export_options, controller, field_override)
601 export.main()
603 if controller:
--> 604 un_stats = export_associations_controllers(
605 controller,
606 associations="UN_ASSOCIATIONS" in export_options,
607 controllers="UN_CONTROLLERS" in export_options,
608 warned=already_warned,
609 **kwargs,
610 )
611 else:
612 un_stats = []
File D:\ArcGIS\UtilityDataManagementSupport.atbx\udms\logic\summarize.py:1549, in export_associations_controllers(utility_network, associations, controllers, warned, **kwargs)
1547 exporters = []
1548 if associations:
-> 1549 exporters.append(AssociationExporter(un, **kwargs))
1550 if controllers:
1551 exporters.append(ControllerExporter(un, **kwargs))
File D:\ArcGIS\UtilityDataManagementSupport.atbx\udms\logic\summarize.py:1177, in AssociationExporter.init(self, un, **kwargs)
1175 def init(self, un: un_helper.UtilityNetwork, **kwargs):
1176 kwargs["un"] = un
-> 1177 kwargs["datasets"] = (Dataset(un.association_table(), "Associations", False),)
1178 super().init(**kwargs)
File D:\ArcGIS\UtilityDataManagementSupport.atbx\udms\un_helper.py:1315, in UtilityNetwork.association_table(self)
1313 if not self.is_service:
1314 assoc_name = self.describe.associationSource.name.split("_")[-1]
-> 1315 return self._un_table(500001, assoc_name, False)
File D:\ArcGIS\UtilityDataManagementSupport.atbx\udms\un_helper.py:1373, in UtilityNetwork._un_table(self, service_id, client_server_name, path_only)
1371 if path_only:
1372 return pth
-> 1373 return arcpy.MakeTableView_management(pth, uuid.uuid4().hex)[0]
File c:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py:16365, in MakeTableView(in_table, out_view, where_clause, workspace, field_info)
16363 return retval
16364 except Exception as e:
16365 raise e
File c:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py:16361, in MakeTableView(in_table, out_view, where_clause, workspace, field_info)
16357 from arcpy.arcobjects.arcobjectconversion import convertArcObjectToPythonObject
16359 try:
16360 retval = convertArcObjectToPythonObject(
16361 gp.MakeTableView_management(*gp_fixargs((in_table, out_view, where_clause, workspace, field_info), True))
16362 )
16363 return retval
16364 except Exception as e:
File c:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing_base.py:533, in Geoprocessor.getattr..(*args)
531 val = getattr(self._gp, attr)
532 if callable(val):
--> 533 return lambda *args: val(*gp_fixargs(args, True))
534 else:
535 return convertArcObjectToPythonObject(val)
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000732: Input Table: Dataset D:\ArcGIS\Connection.sde\UN_5609_Associations does not exist or is not supported
Failed to execute (MakeTableView).
To Reproduce
Steps to reproduce the behavior:
- Create Utility Network in Oracle Database
- Create User who is not UN Owner to access Utility Network
- Run ExportReportingData with Path to controller dataset consisting using sde connection file with non-UN Owner user
a. [SDE Connection File Path][Schema Name].[Feature Dataset Name][Schema Name].[Utility Network Name]
- Include "UN_ASSOCIATIONS" in output_options
- Get Error
Expected behavior
Tool executes and includes schema name in name of UN Associations table (i.e. fully qualified) and tool works as expected.
Describe the bug
Receiving Error when running ExportReportingData using SDE connection to Oracle Database as user who is not the data owner. Error states that the UN Associations table does not exist in SDE. It is trying to access the table without prefixing the schema name, i.e. [sde connection file path]\UN_5609_Associations instead of [sde connection file path]**[schema name]**.UN_5609_Associations.
ExecuteError Traceback (most recent call last)
File D:\ArcGIS\UtilityDataManagementSupport.atbx\ExportReportingData.tool\tool.script.execute.py:14
File D:\ArcGIS\UtilityDataManagementSupport.atbx\udms\esri.py:557, in gp_wrapper..wrapper(*args, **kwargs)
555 start = time.perf_counter()
556 try:
--> 557 f = func(*args, **kwargs)
558 finally:
559 logger.debug(f"{func.module}.{func.qualname}\t{time.perf_counter() - start}")
File D:\ArcGIS\UtilityDataManagementSupport.atbx\udms\logic_init_.py:604, in reporting_gdb(datasets, output_workspace, export_options, controller, field_override)
601 export.main()
603 if controller:
--> 604 un_stats = export_associations_controllers(
605 controller,
606 associations="UN_ASSOCIATIONS" in export_options,
607 controllers="UN_CONTROLLERS" in export_options,
608 warned=already_warned,
609 **kwargs,
610 )
611 else:
612 un_stats = []
File D:\ArcGIS\UtilityDataManagementSupport.atbx\udms\logic\summarize.py:1549, in export_associations_controllers(utility_network, associations, controllers, warned, **kwargs)
1547 exporters = []
1548 if associations:
-> 1549 exporters.append(AssociationExporter(un, **kwargs))
1550 if controllers:
1551 exporters.append(ControllerExporter(un, **kwargs))
File D:\ArcGIS\UtilityDataManagementSupport.atbx\udms\logic\summarize.py:1177, in AssociationExporter.init(self, un, **kwargs)
1175 def init(self, un: un_helper.UtilityNetwork, **kwargs):
1176 kwargs["un"] = un
-> 1177 kwargs["datasets"] = (Dataset(un.association_table(), "Associations", False),)
1178 super().init(**kwargs)
File D:\ArcGIS\UtilityDataManagementSupport.atbx\udms\un_helper.py:1315, in UtilityNetwork.association_table(self)
1313 if not self.is_service:
1314 assoc_name = self.describe.associationSource.name.split("_")[-1]
-> 1315 return self._un_table(500001, assoc_name, False)
File D:\ArcGIS\UtilityDataManagementSupport.atbx\udms\un_helper.py:1373, in UtilityNetwork._un_table(self, service_id, client_server_name, path_only)
1371 if path_only:
1372 return pth
-> 1373 return arcpy.MakeTableView_management(pth, uuid.uuid4().hex)[0]
File c:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py:16365, in MakeTableView(in_table, out_view, where_clause, workspace, field_info)
16363 return retval
16364 except Exception as e:
File c:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py:16361, in MakeTableView(in_table, out_view, where_clause, workspace, field_info)
16357 from arcpy.arcobjects.arcobjectconversion import convertArcObjectToPythonObject
16359 try:
16360 retval = convertArcObjectToPythonObject(
File c:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing_base.py:533, in Geoprocessor.getattr..(*args)
531 val = getattr(self._gp, attr)
532 if callable(val):
--> 533 return lambda *args: val(*gp_fixargs(args, True))
534 else:
535 return convertArcObjectToPythonObject(val)
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000732: Input Table: Dataset D:\ArcGIS\Connection.sde\UN_5609_Associations does not exist or is not supported
Failed to execute (MakeTableView).
To Reproduce
Steps to reproduce the behavior:
a. [SDE Connection File Path][Schema Name].[Feature Dataset Name][Schema Name].[Utility Network Name]
Expected behavior
Tool executes and includes schema name in name of UN Associations table (i.e. fully qualified) and tool works as expected.