Repository navigation
Don't return an empty publisher from get_location_and_publisher - #14149
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
Thanks for the PR, @Kiddo4993 — and welcome, this looks like your first contribution to Open Library! 🎉 The linked issue hasn't been triaged yet — triage happens on Mondays and Fridays. There are currently 99 open non-draft PRs ahead of yours. PR triage checklist (maintainers / Pierre)
Note This comment was automatically generated by Pierre, Open Library's PR first-touch assistant, on behalf of @mekarpeles. This is NOT a code review or sign-off. |
add a populatued value with no colon publisher test to properly test the second path
208bb63 to
4ff6aba
Compare
6c0e7aa to
7066149
Compare
7066149 to
b25c550
Compare
for more information, see https://pre-commit.ci
The ignore in test_get_location_and_publisher_bad_type sat on the list assignment, but mypy reports the error on the call as [arg-type]. The test only started being checked once #14149 added a -> None annotation, so pre-commit.ci mypy has failed on master since then.
…rnetarchive#14149) * Don't return an empty publisher from get_location_and_publisher Fixes internetarchive#14140 * refactor * parametrize test_get_colon_only_loc_pub * refactor test with parametrize add a populatued value with no colon publisher test to properly test the second path * correct parametrize argument types * type hint * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Raymond Berger <RayBB@users.noreply.github.com> Co-authored-by: Charles Horn <charles.horn@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…rnetarchive#14149) * Don't return an empty publisher from get_location_and_publisher Fixes internetarchive#14140 * refactor * parametrize test_get_colon_only_loc_pub * refactor test with parametrize add a populatued value with no colon publisher test to properly test the second path * correct parametrize argument types * type hint * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Raymond Berger <RayBB@users.noreply.github.com> Co-authored-by: Charles Horn <charles.horn@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…rnetarchive#14149) * Don't return an empty publisher from get_location_and_publisher Fixes internetarchive#14140 * refactor * parametrize test_get_colon_only_loc_pub * refactor test with parametrize add a populatued value with no colon publisher test to properly test the second path * correct parametrize argument types * type hint * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Raymond Berger <RayBB@users.noreply.github.com> Co-authored-by: Charles Horn <charles.horn@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…rnetarchive#14149) * Don't return an empty publisher from get_location_and_publisher Fixes internetarchive#14140 * refactor * parametrize test_get_colon_only_loc_pub * refactor test with parametrize add a populatued value with no colon publisher test to properly test the second path * correct parametrize argument types * type hint * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Raymond Berger <RayBB@users.noreply.github.com> Co-authored-by: Charles Horn <charles.horn@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…rnetarchive#14149) * Don't return an empty publisher from get_location_and_publisher Fixes internetarchive#14140 * refactor * parametrize test_get_colon_only_loc_pub * refactor test with parametrize add a populatued value with no colon publisher test to properly test the second path * correct parametrize argument types * type hint * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Raymond Berger <RayBB@users.noreply.github.com> Co-authored-by: Charles Horn <charles.horn@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Fixes #14140.
get_location_and_publisher()strips out thePlace of publication not identifiedmarker. When that marker was the whole input, the fallback branch still wrapped the now-empty string in a list and returned([], [""]). The import API only checks whether the publisher list is non-empty, so this empty string could end up in edition metadata aspublishers=[""].The fallback now returns an empty publisher list when the stripped value is empty. The colon-separated branch already filters out empty items, so this makes the two paths behave the same way.
Tests: I added cases to
test_get_location_and_publisherfor"Place of publication not identified"and"[Place of publication not identified]". Both should return([], []). I couldn't run the tests in this environment.Fixes #14140
Happy to adjust anything or close it if it isn't a fit.