Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

full joins withe coalesce #86

Closed
topofocus opened this issue Oct 16, 2024 · 2 comments
Closed

full joins withe coalesce #86

topofocus opened this issue Oct 16, 2024 · 2 comments

Comments

@topofocus
Copy link

topofocus commented Oct 16, 2024

Recently I switched to the most recent version of this fantastic gem.

However, the compatibility of joins is not perfect.
In Version 0.31 it was possible to perform join ... how: 'outer',

Now it's join ... how: 'full'

Polars performs a full-join with coalesce: false. The result is shown below

┌────────────┬──────────┬─────────────┬───────────┬──────────────────┐
│ datum      ┆ max      ┆ datum_right ┆ reference ┆ reference_border │
│ ---        ┆ ---      ┆ ---         ┆ ---       ┆ ---              │
│ date       ┆ f64      ┆ date        ┆ f64       ┆ i64              │
╞════════════╪══════════╪═════════════╪═══════════╪══════════════════╡
│ 2023-08-31 ┆ 7308.2   ┆ 2023-08-31  ┆ 6600.0    ┆ 6534             │
│ 2023-09-01 ┆ 7305.269 ┆ null        ┆ null      ┆ null             │
│ 2023-09-04 ┆ 7308.6   ┆ null        ┆ null      ┆ null             │
│ 2023-09-05 ┆ 7280.8   ┆ null        ┆ null      ┆ null             │
│ 2023-09-06 ┆ 7264.5   ┆ null        ┆ null      ┆ null             │
│ …          ┆ …        ┆ …           ┆ …         ┆ …                │
│ 2024-10-11 ┆ 8214.9   ┆ null        ┆ null      ┆ null             │
│ 2024-10-14 ┆ 8251.9   ┆ null        ┆ null      ┆ null             │
│ 2024-10-15 ┆ 8314.5   ┆ null        ┆ null      ┆ null             │
│ 2024-10-16 ┆ 8318.37  ┆ null        ┆ null      ┆ null             │
│ null       ┆ null     ┆ 2024-12-19  ┆ 8300.0    ┆ 6534             │
└────────────┴──────────┴─────────────┴───────────┴──────────────────┘

Instead of joining the dataframes on "datum", a datum_right column is added.

According to the python-reference
the parameter coalesce: true resets the behavior to the 'old'-version.

I tried to patch the library, without success so far.

@ankane
Copy link
Owner

ankane commented Oct 16, 2024

Hi @topofocus, the coalesce option was added in #83 and will be available in the next release.

@ankane ankane closed this as completed Oct 16, 2024
@topofocus
Copy link
Author

Thanks!

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

No branches or pull requests

2 participants