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

Join suffix has no impact #219

Closed
jnutter opened this issue Jun 8, 2024 · 1 comment · Fixed by #220
Closed

Join suffix has no impact #219

jnutter opened this issue Jun 8, 2024 · 1 comment · Fixed by #220
Assignees
Labels
bug Something isn't working

Comments

@jnutter
Copy link

jnutter commented Jun 8, 2024

Have you tried latest version of polars?

yes

What version of polars are you using?

nodejs-polars 12.2 but tried 11 and 10 with no success either

What operating system are you using polars on?

MacOS 14.5

What node version are you using

20.9.0

Describe your bug.

I am attempting to join 2 pivot tables together. The table being joined always has the suffix _right. I do see the correct suffix being passed into wrap("join", other._df, leftOn, rightOn, how, suffix); however did not explore deeper.

What are the steps to reproduce the behavior?

import pl from 'nodejs-polars';

const df1 = pl.DataFrame({
  id: [1, 2, 3],
  name: ['Alice', 'Bob', 'Charlie'],
});

const df2 = pl.DataFrame({
  id: [1, 2, 4],
  name: ['Alice2', 'Bob2', 'Charlie2'],
});

// Perform a join operation
const joinedDF = df1.join(df2, { on: 'id', how: 'inner', suffix: '_clone' });

console.log(joinedDF.toString());

What is the actual behavior?

┌─────┬───────┬────────────┐
│ id  ┆ name  ┆ name_right │
│ --- ┆ ---   ┆ ---        │
│ f64 ┆ str   ┆ str        │
╞═════╪═══════╪════════════╡
│ 1.0 ┆ Alice ┆ Alice2     │
│ 2.0 ┆ Bob   ┆ Bob2       │
└─────┴───────┴────────────┘

What is the expected behavior?

┌─────┬───────┬────────────┐
│ id  ┆ name  ┆ name_clone │
│ --- ┆ ---   ┆ ---        │
│ f64 ┆ str   ┆ str        │
╞═════╪═══════╪════════════╡
│ 1.0 ┆ Alice ┆ Alice2     │
│ 2.0 ┆ Bob   ┆ Bob2       │
└─────┴───────┴────────────┘

What do you think polars should have done?

Change name_right to name_clone

@jnutter jnutter added the bug Something isn't working label Jun 8, 2024
@Bidek56 Bidek56 self-assigned this Jun 9, 2024
@Bidek56
Copy link
Collaborator

Bidek56 commented Jun 9, 2024

@jnutter Thx for pointing this out!!

universalmind303 pushed a commit that referenced this issue Jun 9, 2024
Adding JoinArgs to fix join suffix to close #219
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants