Conversation
eb2d8aa to
a4f13de
Compare
|
Nit: suggest revising the release note entry to follow the Order of changes in the release note guidelines. Maybe: |
| public Page replaceColumn(int channelIndex, Block column) | ||
| { | ||
| if (column.getPositionCount() != positionCount) { | ||
| throw new IllegalArgumentException("New column does not have same number of rows as old column"); |
There was a problem hiding this comment.
Replace: New column does not have same number of rows as old column -> New block does not have the same number of rows as the page
Technically current page implementation allows to have blocks with different number of rows, but I think it's ok to enforce this constraint.
There was a problem hiding this comment.
appendColumn and prependColumn do check for this though interestingly, as you point out, the constructor does not.
| * @return a new page with the replacement column substituted for the old column | ||
| */ | ||
| public Page replaceColumn(int channelIndex, Block column) | ||
| { |
There was a problem hiding this comment.
Check and throw if the channelIndex is invalid
There was a problem hiding this comment.
There are unit tests that verify the correct exception is thrown in this case.
|
For the release note, it should be in a section titled SPI. |
Description
Replace a column (block) in a page with a new column/bliock.
Motivation and Context
#22078 For row IDs we need to replace a row number block with a row ID block. however the functionality seems generally useful and has no particular dependence on row IDs.
Impact
Add new replaceColumn method to com.facebook.common.Page
Test Plan
Added unit tests to TestPage class
Contributor checklist
Release Notes