Fix pandas 2.x compatibility by replacing deprecated DataFrame/Series.append#342
Open
wavebyrd wants to merge 1 commit intogoldmansachs:masterfrom
Open
Fix pandas 2.x compatibility by replacing deprecated DataFrame/Series.append#342wavebyrd wants to merge 1 commit intogoldmansachs:masterfrom
wavebyrd wants to merge 1 commit intogoldmansachs:masterfrom
Conversation
….append The append() method was removed in pandas 2.0. This change replaces all occurrences with pd.concat() to ensure compatibility with pandas 2.x while maintaining backward compatibility with pandas 1.x. Affected files: - utility_processors.py: AppendProcessor.process() - tree_entity.py: AssetTreeNode.__build_constituents_df() - hedge.py: Hedge.create_transaction_cost_data_structures() - results.py: _compose() Fixes goldmansachs#337 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Author
|
Ping on this pandas 2.x compatibility fix. Replaces deprecated .append() with pd.concat(). Ready for review! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DataFrame.append()andSeries.append()calls withpd.concat()for pandas 2.x compatibilityAttributeErrorwhen using gs-quant with pandas >= 2.0Changes
utility_processors.pyAppendProcessor.process()a.append(b)→pd.concat([a, b])tree_entity.pyAssetTreeNode.__build_constituents_df()df.append(...)→pd.concat([...], ignore_index=True)hedge.pyHedge.create_transaction_cost_data_structures()results.py_compose()lhs.append(rhs)→pd.concat([lhs, rhs])Test plan
Fixes #337
🤖 Generated with Claude Code