Skip to content

fix two validate database checks that never ran - #139

Open
dereklichtner wants to merge 1 commit into
DOI-USGS:masterfrom
dereklichtner:fix/validate-skipped-checks-master
Open

dereklichtner wants to merge 1 commit into
DOI-USGS:masterfrom
dereklichtner:fix/validate-skipped-checks-master

Conversation

@dereklichtner

Copy link
Copy Markdown

Two checks in GeMS_ValidateDatabase.py never actually ran. Checks would always pass even if dataset was not correct.

compare_sr() meant to flag when two feature classes use different spatial references but it was reading both spatial refs from the first feature class:

sr1 = db_dict[obj1]["spatialReference"].name
sr2 = db_dict[obj1]["spatialReference"].name   # should be obj2

So it always compared a feature class to itself and never reported a mismatch.

Also, metadata check used Path(metadata_file).exists ie the method itself. "Does not exist" branch would never run and validate_w_mp() was passed missing file. Now calls .exists() with parentheses

Verified with ArcGIS Pro 3.6.1 with WSGS GeMS gdbs.

The affected lines are the same on master and Version-3.

compare_sr read obj1 twice instead of obj2; metadata check used .exists without parens so it was always truthy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant