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

Subclasses of ColumnType #113

Closed
lars-reimann opened this issue Mar 29, 2023 · 2 comments · Fixed by #132
Closed

Subclasses of ColumnType #113

lars-reimann opened this issue Mar 29, 2023 · 2 comments · Fixed by #132
Assignees
Labels
enhancement 💡 New feature or request released Included in a release

Comments

@lars-reimann
Copy link
Member

lars-reimann commented Mar 29, 2023

Is your feature request related to a problem?

The names of the subclasses of ColumnType are unnecessarily lengthy, which is annoying when one has to specify a schema manually. Moreover, there is no obvious way to express that a column contains mixed data.

Desired solution

Rename classes or create new ones as follows:

old new
IntColumnType Integer
BooleanColumnType Boolean
FloatColumnType RealNumber
StringColumnType String
OptionalColumnType turn into constructor parameter of each other type
- Anything (to express that the column contains different types of data)

Possible alternatives (optional)

No response

Screenshots (optional)

No response

Additional Context (optional)

No response

@lars-reimann lars-reimann added enhancement 💡 New feature or request good first issue Good for newcomers labels Mar 29, 2023
@lars-reimann lars-reimann changed the title Rename sublasses of ColumnType Sublasses of ColumnType Mar 29, 2023
@lars-reimann
Copy link
Member Author

Replacement for OptionalColumnType:

I'm not sure about Missable. I've chosen this since we talk about "missing values" everywhere else. Other options would be:

  • Nullable: Such values are often also called "null values". However, they are usually expressed as either None or np.nan.
  • Optional: The typing package uses this term. That is also a problem, though, since users could inadvertently import the wrong declaration. If they need both, they would also need to import one under an alias. => No

Class for nullability vs. parameter:

Instead of wrapping a ColumnType into a Nullable to express that values can be missing, we could also pass an argument is_nullable to the constructor of each type.

@lars-reimann lars-reimann changed the title Sublasses of ColumnType Subclasses of ColumnType Mar 30, 2023
@lars-reimann lars-reimann self-assigned this Mar 31, 2023
@lars-reimann lars-reimann linked a pull request Mar 31, 2023 that will close this issue
@lars-reimann lars-reimann removed the good first issue Good for newcomers label Mar 31, 2023
lars-reimann added a commit that referenced this issue Mar 31, 2023
Closes #113.

### Summary of Changes

* Rename subclasses:
  | old| new |
  |--------|--------|
  | IntColumnType | Integer |
  | BooleanColumnType | Boolean |
  | FloatColumnType | RealNumber |
  | StringColumnType | String |
* Add new subclass `Anything` for columns that contain any values
* Add parameter `is_nullable` to all types to indicate that null values
are allowed
* Add tests

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
lars-reimann pushed a commit that referenced this issue Mar 31, 2023
## [0.8.0](v0.7.0...v0.8.0) (2023-03-31)

### Features

* create empty `Table` without schema ([#128](#128)) ([ddd3f59](ddd3f59)), closes [#127](#127)
* improve `ColumnType`s ([#132](#132)) ([1786a87](1786a87)), closes [#113](#113)
* infer schema of row if not passed explicitly ([#134](#134)) ([c5869bb](c5869bb)), closes [#15](#15)
* new method `is_fitted` to check whether a model is fitted ([#130](#130)) ([8e1c3ea](8e1c3ea))
* new method `is_fitted` to check whether a transformer is fitted ([#131](#131)) ([e20954f](e20954f))
* rename `drop_XY` methods of `Table` to `remove_XY` ([#122](#122)) ([98d76a4](98d76a4))
* rename `fit_transform` to `fit_and_transform` ([#119](#119)) ([76a7112](76a7112)), closes [#112](#112)
* rename `shuffle` to `shuffle_rows` ([#125](#125)) ([ea21928](ea21928))
* rename `slice` to `slice_rows` ([#126](#126)) ([20d21c2](20d21c2))
* rename `TableSchema` to `Schema` ([#133](#133)) ([1419d25](1419d25))
@lars-reimann
Copy link
Member Author

🎉 This issue has been resolved in version 0.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lars-reimann lars-reimann added the released Included in a release label Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 💡 New feature or request released Included in a release
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant