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

GroupBy.sort and sortBy vague error reporting #780

Open
koperagen opened this issue Jul 15, 2024 · 0 comments
Open

GroupBy.sort and sortBy vague error reporting #780

koperagen opened this issue Jul 15, 2024 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@koperagen
Copy link
Collaborator

koperagen commented Jul 15, 2024

Given https://www.kaggle.com/datasets/ruchi798/data-science-job-salaries and

@DataSchema
interface DsSalaries {
    @ColumnName("company_location")
    val companyLocation: String
    @ColumnName("company_size")
    val companySize: String
    @ColumnName("employee_residence")
    val employeeResidence: String
    @ColumnName("employment_type")
    val employmentType: String
    @ColumnName("experience_level")
    val experienceLevel: String
    @ColumnName("job_title")
    val jobTitle: String
    @ColumnName("remote_ratio")
    val remoteRatio: Int
    val salary: Int
    @ColumnName("salary_currency")
    val salaryCurrency: String
    @ColumnName("salary_in_usd")
    val salaryInUsd: Int
    val untitled: Int
    @ColumnName("work_year")
    val workYear: Int
}

This doesn't fail
df.group { salaryInUsd }.into("group").groupBy { companyLocation }.sortBy(pathOf("group", "salaryInUsd")).print()
This does with "can't apply sort flag to column group":
df.group { salaryInUsd }.into("group").groupBy { companyLocation }.sortByDesc(pathOf("group", "salaryInUsd")).print()

In reality, both snippets are wrong and it should be sortBy(pathOf("group", "group", "salary_in_usd")) (which itself is confusing).
These functions should report that pathOf("group", "salaryInUsd") doesn't exist in both cases

@koperagen koperagen added the bug Something isn't working label Jul 15, 2024
@zaleslaw zaleslaw added this to the 0.14.0 milestone Jul 19, 2024
@zaleslaw zaleslaw modified the milestones: 0.14.0, Backlog Sep 16, 2024
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

No branches or pull requests

2 participants