Skip to content

Commit 7dbe651

Browse files
fix(explode): rename ignore_index to ignoreIndex in ExplodeOptions
The ExplodeOptions interface used snake_case `ignore_index` while all tests and TypeScript conventions use camelCase `ignoreIndex`. This caused three test failures: - explodeSeries > "resets to RangeIndex when ignoreIndex=true" - explodeDataFrame > "resets to RangeIndex when ignoreIndex=true" - property test "ignore_index produces RangeIndex 0..n-1" Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 798f055 commit 7dbe651

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/reshape/explode.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export interface ExplodeOptions {
3636
* When `false` (default), the original row labels are propagated
3737
* (duplicated once for each element of each list value).
3838
*/
39-
readonly ignore_index?: boolean;
39+
readonly ignoreIndex?: boolean;
4040
}
4141

4242
// ─── helpers ──────────────────────────────────────────────────────────────────
@@ -89,7 +89,7 @@ function expandCell(value: Scalar): Scalar[] {
8989
* ```
9090
*/
9191
export function explodeSeries(series: Series<Scalar>, options?: ExplodeOptions): Series<Scalar> {
92-
const ignoreIndex = options?.ignore_index ?? false;
92+
const ignoreIndex = options?.ignoreIndex ?? false;
9393
const outValues: Scalar[] = [];
9494
const outLabels: Label[] = [];
9595

@@ -122,7 +122,7 @@ export function explodeSeries(series: Series<Scalar>, options?: ExplodeOptions):
122122
* Explode one or more list-valued columns of a DataFrame into multiple rows.
123123
*
124124
* All other columns have their values repeated to match the expanded rows.
125-
* Row labels are propagated (duplicated) unless `ignore_index` is `true`.
125+
* Row labels are propagated (duplicated) unless `ignoreIndex` is `true`.
126126
*
127127
* When multiple columns are specified they must have the same list lengths per
128128
* row — pandas raises a `ValueError` for mismatched lengths; here each column
@@ -150,9 +150,8 @@ export function explodeDataFrame(
150150
column: string | readonly string[],
151151
options?: ExplodeOptions,
152152
): DataFrame {
153-
const ignoreIndex = options?.ignore_index ?? false;
153+
const ignoreIndex = options?.ignoreIndex ?? false;
154154
const explodeCols: readonly string[] = typeof column === "string" ? [column] : column;
155-
156155
// Validate column names
157156
for (const col of explodeCols) {
158157
if (!df.columns.values.includes(col)) {

0 commit comments

Comments
 (0)