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

Make empty field checks pythonic #778

Merged
merged 1 commit into from
May 15, 2024
Merged

Make empty field checks pythonic #778

merged 1 commit into from
May 15, 2024

Conversation

seth-shaw-asu
Copy link
Contributor

Works with both None values and empty strings.

Link to Github issue or other discussion

Fix for https://islandora.slack.com/archives/C01TLCB0EEQ/p1715094887941549

What does this PR do?

Fixes issue where empty values caused taxonomy lookups to throw errors resulting in failed entity reference revisions updates.

What changes were made?

s#if row[field_name] is None#if not row[field_name]#

How to test / verify this PR?

See linked Slack conversation above.

Interested Parties

@mjordan, Dara Virks, and @dmer


Checklist

  • Before opening this PR, have you opened an issue explaining what you want to to do?
  • Have you included some configuration and/or CSV files useful for testing this PR?
  • Have you written unit or integration tests if applicable?
  • Does the code added in this PR require a version of Python that is higher than the current minimum version?
  • If the changes in this PR require an additional Python library, have you included it in setup.py?
  • If the changes in this PR add a new configuration option, have you provided a default for when the option is not present in the .yml file?

Works with both `None` values and empty strings.
@mjordan
Copy link
Owner

mjordan commented May 13, 2024

@dara2 can you check out this branch and re-do your testing? If you encounter no problems I can merge.

@dara2
Copy link

dara2 commented May 15, 2024

@mjordan confirmed that this works!

@mjordan
Copy link
Owner

mjordan commented May 15, 2024

Awesome, thanks!

@mjordan mjordan merged commit e7e55ca into mjordan:main May 15, 2024
5 checks passed
@mjordan
Copy link
Owner

mjordan commented May 15, 2024

Thanks @seth-shaw-asu !

@mjordan
Copy link
Owner

mjordan commented May 16, 2024

Any changes to the docs required because of this fix? Maybe incorporating mention of the null value from https://islandora.slack.com/archives/C01TLCB0EEQ/p1715019192375069?

@seth-shaw-asu
Copy link
Contributor Author

It wouldn't hurt to note that all subfields must be accounted for in a value, even if they are blank, just like any other row in a CSV. We could expand the existing title example with the one I gave in Slack: https://islandora.slack.com/archives/C01TLCB0EEQ/p1715034820145449

@seth-shaw-asu seth-shaw-asu deleted the merleaux-virks branch May 16, 2024 16:34
@mjordan
Copy link
Owner

mjordan commented May 16, 2024

Thanks Seth I'll add that in the next few days and ask you all to do a quick review.

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.

3 participants