Collect stream chunks before passing to vstack #75
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #73
While I wasn't able to definitively track down precisely which change in numpy 1.17 introduced this problem, I believe it is related to a breaking change in a test build that removed the ability of
numpy.vstack()and friends to accept generators, which was then rolled back in favor of a deprecation warning beginning in 1.16. If these deprecations were flagged in release notes, I haven't been able to find them.The deprecation warning still shows up under 1.17:
But manually reproducing one of the failing tests still produces an error:
So this can't be the sole cause of the bark test failures. But rolling all of a stream's chunks into a tuple before passing them to
numpy.vstack()does resolve the problem, so there must be an interaction between numpy's expectations and the Stream class's iteration behavior producing the errors.I think this is as deep as I can go at the moment. The previously failing tests run, and manual tests of complex functionality (including
bark-label-view) don't break. And collecting the chunks before handing them tonumpy.vstack()does not appear to produce a performance penalty (they'd just be collected byvstack()anyway).This change now means that the numpy version doesn't need to be specified in the requirements file, and also releases the restriction on the pandas version (as pandas 1.3 requires numpy>=1.17).