kosiew commented on code in PR #1184:
URL:
https://github.com/apache/datafusion-python/pull/1184#discussion_r2194093566
##########
python/tests/test_dataframe.py:
##########
@@ -400,7 +400,6 @@ def test_unnest_without_nulls(nested_df):
assert result.column(1) == pa.array([7, 8, 8, 9, 9, 9])
Review Comment:
It would be good if new tests for keep_duplicate_keys=False or True were
added. To ensure coverage, add tests verifying that passing
keep_duplicate_keys=True preserves both columns.
##########
python/datafusion/dataframe.py:
##########
@@ -678,6 +681,7 @@ def join(
left_on: str | Sequence[str] | None = None,
right_on: str | Sequence[str] | None = None,
join_keys: tuple[list[str], list[str]] | None = None,
+ keep_duplicate_keys: bool = False,
Review Comment:
The name keep_duplicate_keys is somewhat confusing: it drops the right-side
keys when False.
A more direct name like drop_duplicate_keys: bool = False (default) or
deduplicate: bool = False may better express intent.
Additionally, in many DataFrame libraries (Pandas, PySpark), the term
suffixes or indicator is used for duplicate‐column handling. Consider whether a
suffix‐based approach (with default ('', '_right')) could be more familiar to
users than a boolean drop flag.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]