Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

for fixStrings, add editor and workspace in fixTableStrings #84

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

dmirandaUSGS
Copy link
Contributor

@dmirandaUSGS dmirandaUSGS commented Sep 29, 2023

FixStrings silently fails if a feature class participates in a topology class, that feature class is just skipped entirely and no error messages are thrown. Additionally, the tool can't update feature classes with active attribute rules as mentioned in the ReadMe.

After some research, it looks like you need to wrap the UpdateCursor in an Editor Session.

See the following:
attribute rule error on update cursor

Objects in this class cannot be updated outside an edit session

Note for that second link, I did not actually see the error, but it does specifically state that feature classes in a topology cannot be edited unless they are in an edit session.

So, I made a couple small changes to add an Editor to the script and tested it both with a feature class that participates in topology as well as one that had active attribute rules and the script works. Note that I did not change anything in the ReadMe about the limitation with attribute rules. It's probably worth more extensive testing before knowing for sure it was fixed.

@ethoms-usgs ethoms-usgs merged commit 3e64132 into DOI-USGS:master Oct 5, 2023
@ethoms-usgs
Copy link
Collaborator

Tested with a feature class in topology and works as expected. Thanks!

@dmirandaUSGS dmirandaUSGS deleted the fix-string-issues branch October 5, 2023 16:05
@dmirandaUSGS dmirandaUSGS restored the fix-string-issues branch October 5, 2023 16:05
@dmirandaUSGS dmirandaUSGS deleted the fix-string-issues branch October 5, 2023 16:05
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.

None yet

2 participants