FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Reset the iterator in LatLongPrecisionParser when one of them error out by Ladsgroup · Pull Request #178 · DataValues/Geo · GitHub

/ Geo Public

Reset the iterator in LatLongPrecisionParser when one of them error out - #178

Closed
Ladsgroup wants to merge 1 commit into
masterfrom
reset_parsers_on_error
Closed

Reset the iterator in LatLongPrecisionParser when one of them error out#178
Ladsgroup wants to merge 1 commit into
masterfrom
reset_parsers_on_error

Conversation

Ladsgroup commented Dec 18, 2019
edited by JeroenDeDauw
Loading

Copy link
Copy Markdown
Contributor

This avoids errors like "Cannot rewind a generator that was already run"
When the first parser has invalid value but everything after it is okay

Caught with an integration test in ParserValue API module in Wikibase

Bug: https://phabricator.wikimedia.org/T238931

This avoids errors like "Cannot rewind a generator that was already run"
When the first parser has invalid value but everything after it is okay

Caught with an integration test in ParserValue API module in Wikibase

Bug: T238931
Ladsgroup requested a review from addshore December 18, 2019 17:51

Copy link
Copy Markdown
Member

That is pretty strange. The generator is wrapped by CachingIterator, so rewind errors should not happen.

I'll have a look later today and write some unit tests to get to the bottom of this.

Copy link
Copy Markdown
Member

Apparently CachingIterator does not fully cache for partial iterations, hence the error. That makes the code using CachingIterator here pointless, so I've removed it in #180, which fixes the error.

JeroenDeDauw deleted the reset_parsers_on_error branch December 18, 2019 21:23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL