Skip to content

Fix pandas 2.x compat: replace DataFrame.append with pd.concat#345

Open
atharvajoshi01 wants to merge 1 commit intogoldmansachs:masterfrom
atharvajoshi01:fix/337-pandas2-append-compat
Open

Fix pandas 2.x compat: replace DataFrame.append with pd.concat#345
atharvajoshi01 wants to merge 1 commit intogoldmansachs:masterfrom
atharvajoshi01:fix/337-pandas2-append-compat

Conversation

@atharvajoshi01
Copy link
Copy Markdown

Summary

Fixes #337. DataFrame.append and Series.append were removed in pandas 2.0, causing AttributeError for users on pandas >= 2.

Replaced all 5 occurrences across 4 files with pd.concat:

  • gs_quant/analytics/processors/utility_processors.py (line 172)
  • gs_quant/entities/tree_entity.py (lines 113, 116)
  • gs_quant/markets/hedge.py (line 950)
  • gs_quant/risk/results.py (line 129)

List .append() calls (which are valid) were left unchanged.

Test plan

  • Verified no remaining DataFrame.append / Series.append in affected files
  • pd.concat is a drop-in replacement with identical behavior for these use cases

…cat for pandas 2.x compat

DataFrame.append and Series.append were removed in pandas 2.0.
Replaced all occurrences in utility_processors.py, tree_entity.py,
hedge.py, and results.py with pd.concat equivalents.
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.

[BIG REPORT] - Pandas 2.x compatibility: replace removed DataFrame/Series append usage causing runtime failures

1 participant