question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Function sortBy throws MixedTypeError if value in sorted column is null

See original GitHub issue

Hi team,

I’m using dataframe-js v1.3.2 and facing an error when trying to sort dataframe by column that contains null. Please see the following example:

let result = new DataFrame([
  {Name: 'Peter', Age: 16},
  {Name: 'Denis', Age: null}
], ['Name', 'Age']);

result.sortBy('Age')

Please let me know if you are going to fix this in the nearest release. Or please share some thoughts on a workaround. PS. in the project value really needs to stay null so please do not propose change null to zero 😃

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Gmoussecommented, Mar 6, 2019

Hi @episodeyang, Indeed it’s a good idea. I will see to add an additionnal parameter in order to place null, undefined or NaN values first or last.

I will try it today. I hope a release on the 1.4.0.

Stay tuned.

0reactions
Gmoussecommented, Mar 16, 2019

Released in 1.4.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sort Function (SortBy) - Trying to get empty cells to return ...
I have a table with around 7 headings for a simple account information table. Not all accounts have a value for each heading/field...
Read more >
Sort by column ASC, but NULL values first? - Stack Overflow
Agreed; I found this useful when just wanting to sort by whether or not a value was present (in this case, a date)...
Read more >
Using the LINQ OrderBy operator with null values - Jerrie Pelser
This blog post demonstrates a quick tip for sorting values in ascending order when some of the values can potentially be NULL.
Read more >
Excel SORTBY function - custom sort with formula - Ablebits
See how to use the SORTBY function in Excel to sort data by a custom list, in random order, by text length, and...
Read more >
sorting broken if result contains null values #7176 - GitHub
If your result contains null values the sorting breaks with a null pointer exception. Tested with numerical columns.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found