Skip to content

Multiple Arithmetic and Comparison Operations are NOT Supported between Two Series #321

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

Open
10 of 22 tasks
qiao opened this issue Mar 25, 2025 · 0 comments
Open
10 of 22 tasks
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@qiao
Copy link

qiao commented Mar 25, 2025

Have you tried latest version of polars?

Yes

What version of polars are you using?

0.18.0

What operating system are you using polars on?

MacOS 15.3.1

What node version are you using

node 23.10.0

Describe your bug.

Multiple arithmetic and comparison operations are not supported between two series.
Here's the list of operations that I have tested and the ones that support operations between two series are marked with the checkmark:

  • add
  • div
  • divideBy
  • minus
  • modulo
  • mul
  • multiplyBy
  • plus
  • rem
  • sub
  • eq
  • equals
  • greaterThan
  • greaterThanEquals
  • gt
  • gtEq
  • lessThan
  • lessThanEquals
  • lt
  • ltEq
  • neq
  • notEquals

The above checklist is generated with the following script:

const pl = require('nodejs-polars');
const a = pl.Series([1]);
const b = pl.Series([2]);

[
  'add',
  'div',
  'divideBy',
  'minus',
  'modulo',
  'mul',
  'multiplyBy',
  'plus',
  'rem',
  'sub',
  'eq',
  'equals',
  'greaterThan',
  'greaterThanEquals',
  'gt',
  'gtEq',
  'lessThan',
  'lessThanEquals',
  'lt',
  'ltEq',
  'neq',
  'notEquals'
].forEach((op) => {
  try {
    a[op](b);
    console.log(`- [X] ${op}`);
  } catch (e) {
    console.log(`- [ ] ${op}`);
  }
});

What are the steps to reproduce the behavior?

const pl = require('nodejs-polars')

const a = pl.Series([1, 1, 1]);
const b = pl.Series([2, 2, 2]);
a.add(b);

What is the actual behavior?

Uncaught Error
    at dtypeWrap (/opt/homebrew/lib/node_modules/nodejs-polars/bin/series/index.js:30:65)
    at Proxy.add (/opt/homebrew/lib/node_modules/nodejs-polars/bin/series/index.js:92:20) {
  code: 'DateExpected'
}

What is the expected behavior?

The above snippet should return pl.Series([3, 3, 3]).

@qiao qiao added the bug Something isn't working label Mar 25, 2025
@Bidek56 Bidek56 added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed and removed bug Something isn't working labels Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants