Skip to content

NameError raised by ArcGISWorkspace.QueryDatasets() when the workspace is an ArcGIS geodatabase that contains relationship classes #23

@jjrob

Description

@jjrob

Example stack trace:

Traceback (most recent call last):
  File "C:\tmy\DenMod\Arc26\Models\Create_Arc26_Covariates_Py3.py", line 158, in <module>
    main()
  File "C:\tmy\DenMod\Arc26\Models\Create_Arc26_Covariates_Py3.py", line 145, in main
    AddContemporaneousCovariate(connInfo=connInfo,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\tmy\DenMod\Code\Python\DenMod2\src\DenMod\Covariates\__init__.py", line 195, in AddContemporaneousCovariate
    table = gdb.QueryDatasets("TableName = 'ContemporaneousCovariate'", reportProgress=False)[0]
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\tmy7\AppData\Local\ESRI\conda\envs\arcgispro-py3-tina3\Lib\site-packages\GeoEco\Datasets\_DatasetCollection.py", line 66, in QueryDatasets
    datasets = self._QueryDatasets(parsedExpression, progressReporter, options, parentAttrValues)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\tmy7\AppData\Local\ESRI\conda\envs\arcgispro-py3-tina3\Lib\site-packages\GeoEco\Datasets\Collections\_DatasetCollectionTree.py", line 185, in _QueryDatasets
    return self._QueryRecursive(parsedExpression, progressReporter, options, [], 0, parentAttrValues, {}, 'normal')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\tmy7\AppData\Local\ESRI\conda\envs\arcgispro-py3-tina3\Lib\site-packages\GeoEco\Datasets\Collections\_DatasetCollectionTree.py", line 213, in _QueryRecursive
    contents = self._ListContents(pathComponents)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\tmy7\AppData\Local\ESRI\conda\envs\arcgispro-py3-tina3\Lib\site-packages\GeoEco\Datasets\ArcGIS\_ArcGISWorkspace.py", line 196, in _ListContents
    d = gp.Describe(os.path.join(gp.env.workspace, relClass))
                                                   ^^^^^^^^
NameError: name 'relClass' is not defined. Did you mean: 'relclass'?

The problem is that during the MGET 0.8 --> 3.0 rewrite, I miscapitalized a variable, then never created a test case for it (because it is tedious to create geodatabases that have relationship classes), so never caught it.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions