Skip to content

Bug on the Series toArray method removing all the null values #156

Open

Description

@murunwas

Bug on the Series toArray method removing all the null values

Example

const {Series} = require('data-forge');
const series = new Series([null,null,10, 20,null, 30, 40]);
console.log(series.count());
//count=7
console.log(series.toArray());
//results=[ 10, 20, 30, 40 ]

Activity

  1. ashleydavis commented on Mar 9, 2023

    @ashleydavis
    Member

    Hey @murunwas would you mind forking the repo and contributing a failing test for this problem? Then I can work towards fixing the issue and making your test pass.

  2. madnetter commented on Mar 11, 2024

    @madnetter
    Contributor

    It appears that filtering out null objects is an explicitly defined behavior (at least there are tests in the suite verifying it). When changing this behavior a number of tests failed.

    I created a PR that may resolve this issue: #172. This involves the addition of an optional parameter object to the toArray method that allows the caller to specify that they want nulls included. The existing API is maintained and all previously existing tests pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions