tvalentyn commented on code in PR #28523:
URL: https://github.com/apache/beam/pull/28523#discussion_r1331901138
##########
sdks/python/apache_beam/dataframe/frame_base.py:
##########
@@ -678,7 +678,15 @@ def wrap(func):
def wrapper(**kwargs):
for name in defaults_to_populate:
if name not in kwargs:
- kwargs[name] = arg_to_default[name]
+ # In pandas 2, many methods rely on the default copy=None
+ # to mean that copy is the value of copy_on_write. Since
+ # copy_on_write will always be true for Beam, just fill it
+ # in here. In pandas 1, the default was True anyway.
+ if name == 'copy' and arg_to_default[name] is None:
Review Comment:
looks like I added this comment but didn't submit...
##########
sdks/python/apache_beam/dataframe/frame_base.py:
##########
@@ -678,7 +678,15 @@ def wrap(func):
def wrapper(**kwargs):
for name in defaults_to_populate:
if name not in kwargs:
- kwargs[name] = arg_to_default[name]
+ # In pandas 2, many methods rely on the default copy=None
+ # to mean that copy is the value of copy_on_write. Since
+ # copy_on_write will always be true for Beam, just fill it
+ # in here. In pandas 1, the default was True anyway.
+ if name == 'copy' and arg_to_default[name] is None:
Review Comment:
nit: we should be able to move this condition out of the loop, or modify
arg_to_default outside of the wrapper to set appropriate default.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]