Kotlin / Kotlin/dataframe

Generate enum classes as part of DataSchema

Open
#118 1 comment 0 reactions 1 assignee Claimed by @zaleslaw View on GitHub
API Compiler plugin enhancement
Dominant language
Kotlin
Stars
1.1k
Forks
83
Avg merge
4d 12h
Merged PRs (30d)
30

Description

Imagine a CSV with a "day_of_week" column with string values like "monday", "friday", etc. If you could convert this column to an enum, you could use the help of completion to, for example, filter it.

It can be done the same way as generating data schemas:
1. after cell execution in the notebooks
2. on data schema import in gradle project

There are some design questions:
1. What if i don't need an enum?

2. What about normalization? "monday", "Monday" aren't the same thing.
In jupyter, you can normalize values however you want and get a nice enum.
In gradle project code generation happens once, in build time, so your values have to be normalized. How?

3. How many values in the enum is too much?

4. What if not all possible values are present in the column? What should happen if generated schema knows about 2 enum values, but the actual column at runtime has more?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.