Skip to content

Document the real default of index_col in train_test_split_pyspark - #1646

Open
Venish Paneliya (VenishPaneliya) wants to merge 1 commit into
microsoft:mainfrom
VenishPaneliya:index-col-default-doc
Open

Venish Paneliya (VenishPaneliya) wants to merge 1 commit into
microsoft:mainfrom
VenishPaneliya:index-col-default-doc

Conversation

@VenishPaneliya

Copy link
Copy Markdown
Contributor

train_test_split_pyspark takes index_col="tmp_index_col", but its docstring says Default None.

The other four arguments in the same docstring all state their real defaults, and flaml/automl/model.py documents the same argument correctly as Default to "tmp_index_col". in several places, so this line was the outlier. The value is not cosmetic — index_col is forwarded to psDataFrame.to_spark(index_col=...), where None drops the index rather than writing it to a column.

Docstring only, no behaviour change.

train_test_split_pyspark takes index_col="tmp_index_col", but its
docstring says "Default None." The other four arguments in the same
docstring all state their real defaults, and model.py documents the same
argument correctly as "tmp_index_col" in several places, so this one line
was the outlier.

The value matters because index_col is forwarded to
psDataFrame.to_spark(index_col=...), where None drops the index instead
of writing it to a column.
@thinkall
Li Jiang (thinkall) requested a balanced review from Copilot October 21, 2026 14:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The documentation-only correction matches the function’s default and has no unresolved findings.

No open issues 🎉

What changed in this PR

Corrects the documented default for index_col in train_test_split_pyspark.

Changes:

  • Replaces None with "tmp_index_col" in the docstring; runtime behavior is unchanged.
File Description
flaml/​automl/​spark/​utils.py Documents the actual index_col default.

Review effort: Balanced

@thinkall Li Jiang (thinkall) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 81323ad27c5322b43a646eb60f874e32ee873c5e with review-code (Low, gpt-6.1-sol): no actionable source finding in the inspected scope.

The corrected index_col description now matches the actual "tmp_index_col" signature default and its forwarding to Spark/pandas-on-Spark conversion APIs. The complete executable module AST is identical after removing only this changed function docstring; no runtime behavior or default changed.

No Spark runtime test was executed for this documentation-only correction. The current Balanced Copilot recommendation was checked separately from the actual workflow results.

Approval remains withheld: applicable CI check contexts are not all successful; actual current-head pull_request workflows are not all successful. The current-head Build workflow failed on four Ubuntu Python variants. Its representative Ubuntu 3.13 log reports the pytest step timed out after 120 minutes; causes for the other jobs were not individually established. A clean source review or passing local selection does not replace successful actual CI. Failed workflows were not rerun.

Posted by thinkall-agent-auto-reviewer

@VenishPaneliya

Copy link
Copy Markdown
Contributor Author

Thanks for the quick look. Flagging that the four build (ubuntu-latest, ...) failures here aren't from this change — they all hit The action 'Test with pytest' has timed out after 120 minutes, and the same timeout hit #1643's branch (fix/ts-forecast-datetime-index-time-col) at 10:32 today, while main was still green at 02:18. The Windows and Windows-ARM legs pass on this PR.

Ubuntu is the only leg that installs pyspark and prophet, so it carries the spark suite. Is that 120-minute ceiling normally close to the wire, or does something look newly slow to you? Happy to rebase once it clears if that helps.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants