Update Table.GenerateByPage to handle empty tables being returned #484
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.
Per
Table.GenerateByPage
's Helper Functions description, this method should callgetNextPage
until that callback returns null, then will combine all returned pages into a single table.However, when the existing
Table.GenerateByPage
returns an empty table, its actual behavior differs from the above description (see below examples). If the callback returns an empty table,Table.GenerateByPage
may output 0 rows or an extra, all-null row--neither of which seems desirable or in alignment with the above description.This PR addresses these behavior anomalies. (Note: It would be good for someone with internal Power Query knowledge to validate this PR to ensure that it is done in a way that aligns with PQ's lazy paradigm and that it does not trigger extra streaming.)
Demo of Existing's Behavior Anomalies