Skip to content

fix: remove deprecated pandas >= 2.2 args from PandasTableReader#1589

Open
VinayakMaharaj wants to merge 1 commit into
apache:mainfrom
VinayakMaharaj:fix/pandas-csv-deprecation-warnings
Open

fix: remove deprecated pandas >= 2.2 args from PandasTableReader#1589
VinayakMaharaj wants to merge 1 commit into
apache:mainfrom
VinayakMaharaj:fix/pandas-csv-deprecation-warnings

Conversation

@VinayakMaharaj
Copy link
Copy Markdown

Fixes #1417

PandasTableReader._get_loading_kwargs() uses dataclasses.asdict(self) which dumps all fields directly as kwargs to pd.read_table(), including deprecated arguments that trigger FutureWarning on pandas >= 2.2.

Changes

  • Added version-aware filtering in PandasTableReader._get_loading_kwargs() to strip deprecated kwargs (verbose, keep_date_col, delim_whitespace) when running pandas >= 2.2
  • Replaces delim_whitespace=True with sep=r"\s+" as recommended by pandas docs

How I tested this

Verified the deprecated fields are stripped at runtime on pandas >= 2.2 by inspecting the kwargs dict. The existing test suite covers the CSV/table reader behavior.

Notes

PandasCSVReader already had version guards for these same args — this brings PandasTableReader in line with the same pattern.

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code passed the pre-commit check & code is left cleaner/nicer than when first encountered.
  • Any_change_in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future TODOs are captured in comments
  • Project documentation has been updated if adding/changing functionality

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.

Deprecation warnings in Pandas CSV Reader

1 participant