Kotlin / Kotlin/dataframe

`DataColumnArithmetics.kt` inconsistencies

Open
#1,784 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

API enhancement
Dominant language
Kotlin
Stars
1.1k
Forks
83
Avg merge
4d 12h
Merged PRs (30d)
30

Description

There are three things in DataColumnArithmetics.kt that need to be changed:

  1. In the functions
public operator fun AnyCol.plus(str: String): DataColumn<String> = map { it.toString() + str }
// and
public operator fun ColumnReference<Any?>.plus(str: String): ColumnReference<String> = map { it.toString() + str }

if the column contains null values, these functions convert each null to the string "null" and concatenate the argument str with it. These functions should be changed in a way that the null values are preserved. That is, each null value in the original column results in a null value for the corresponding element in the resulting column.

  1. The functions gt and lt are not defined for nullable types. They should also work on columns that contain null values.

  2. We need to add to this file new functions: geq (greater than or equal to) and leq (less than or equal to).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading DataColumnArithmetics.kt and inspect the plus, gt, and lt functions, including their nullable-type handling. Update the requested arithmetic behavior and add geq and leq; done means null values remain null and all four comparison operations are available as specified.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.