pandas-dev / pandas

Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more
https://pandas.pydata.org
BSD 3-Clause "New" or "Revised" License
43.86k stars 18.01k forks source link

BUG: Copy attrs on pd.merge() #60357

Open timhoffm opened 6 days ago

timhoffm commented 6 days ago

This uses the same logic as pd.concat(): Copy attrs only if all input attrs are identical.

I've refactored the handling in finalize from special-casing based on th the method name (previously only "concat") to handling "other" parameters that have an input_objs attribute. This is a more scalable architecture compared to hard-coding method names in finalize.

Tests added for concat() and merge().

Closes #60351.