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

Improve error handling of TaggedTable #150

Closed
lars-reimann opened this issue Apr 2, 2023 · 4 comments · Fixed by #450
Closed

Improve error handling of TaggedTable #150

lars-reimann opened this issue Apr 2, 2023 · 4 comments · Fixed by #450
Assignees
Labels
documentation 📖 Improvements or additions to documentation enhancement 💡 New feature or request released Included in a release testing 🧪 Additional automated tests

Comments

@lars-reimann
Copy link
Member

lars-reimann commented Apr 2, 2023

Is your feature request related to a problem?

In some cases, error handling is not ideal (see solution for details).

Desired solution

  • Validate inputs of a function as the first step
  • Raise an appropriate exception with an appropriate message if issues are found
  • Document in the docstring that the exception is raised and under which condition
  • Test that the correct exception with the correct message is raised

Possible alternatives (optional)

No response

Screenshots (optional)

No response

Additional Context (optional)

No response

@lars-reimann lars-reimann added the enhancement 💡 New feature or request label Apr 2, 2023
@github-project-automation github-project-automation bot moved this to Backlog in Library Apr 2, 2023
@lars-reimann lars-reimann added documentation 📖 Improvements or additions to documentation testing 🧪 Additional automated tests labels Apr 2, 2023
@PhilipGutberlet PhilipGutberlet moved this from Backlog to 🧱 Blocked in Library May 12, 2023
@alex-senger
Copy link
Contributor

alex-senger commented May 12, 2023

Blocked by #58

@guenterk
Copy link

guenterk commented Jun 9, 2023

I do not see why #58 blocks this issue. Only testing should be blocked until #58 is completed, to avoid useless double work. There is no reason why #58 prevents input validation, raising exceptions and documenting them. If all of that that is already implemented, mention it in the comment.

@zzril
Copy link
Contributor

zzril commented Jun 16, 2023

Currently, TaggedTable has barely any methods yet.

There are the constructor-like methods _from_table() and __init__(), which do some sort of input validation. (Making sure that the target column won't be a feature column at the same time; not sure what else to validate here?)
The only other methods are mere getters (features and target).

So, currently there's not much (possibly nothing?) to do in terms of "improving error handling" / input validation.

With #58 done, TaggedTable will have a whole lot of new methods, namely those ones inherited (and overridden) from Table.
The solution implemented in the current PR for #58 (#332) does some input validation for these new methods already.

Once that PR is merged, once can think about refining the error handling. (Or alternatively make it part of #58 and drop this separate issue altogether.)

@zzril zzril moved this from 🧱 Blocked to Todo in Library Jul 9, 2023
@jxnior01 jxnior01 self-assigned this Jul 11, 2023
@jxnior01 jxnior01 moved this from Todo to In Progress in Library Jul 13, 2023
@jxnior01 jxnior01 linked a pull request Jul 13, 2023 that will close this issue
@jxnior01 jxnior01 moved this from In Progress to Ready for Review in Library Jul 13, 2023
@zzril zzril moved this from Ready for Review to Ready to Merge in Library Jul 13, 2023
zzril pushed a commit that referenced this issue Jul 13, 2023
Closes #150 

### Summary of Changes

* feat: Validated inputs of functions
* feat: Raised appropriate exceptions with appropriate messages
* docs: Modified docs
* tests: Tested all exceptions

---------

Co-authored-by: megalinter-bot <129584137+megalinter-bot@users.noreply.github.com>
Co-authored-by: Alexander Gréus <alexgreus51@gmail.com>
Co-authored-by: Alexander <47296670+Marsmaennchen221@users.noreply.github.com>
@github-project-automation github-project-automation bot moved this from Ready to Merge to ✔️ Done in Library Jul 13, 2023
lars-reimann pushed a commit that referenced this issue Jul 13, 2023
## [0.15.0](v0.14.0...v0.15.0) (2023-07-13)

### Features

* Add copy method for tables ([#405](#405)) ([72e87f0](72e87f0)), closes [#275](#275)
* add gaussian noise to image ([#430](#430)) ([925a505](925a505)), closes [#381](#381)
* add schema conversions when adding new rows to a table and schema conversion when creating a new table ([#432](#432)) ([6e9ff69](6e9ff69)), closes [#404](#404) [#322](#322) [#127](#127) [#322](#322) [#127](#127)
* add test for empty tables for the method `Table.sort_rows` ([#431](#431)) ([f94b768](f94b768)), closes [#402](#402)
* added color adjustment feature ([#409](#409)) ([2cbee36](2cbee36)), closes [#380](#380)
* added test_repr table tests ([#410](#410)) ([cb77790](cb77790)), closes [#349](#349)
* discretize table ([#327](#327)) ([5e3da8d](5e3da8d)), closes [#143](#143)
* Improve error handling of TaggedTable ([#450](#450)) ([c5da544](c5da544)), closes [#150](#150)
* Maintain tagging in methods inherited from `Table` class ([#332](#332)) ([bc73a6c](bc73a6c)), closes [#58](#58)
* new error class `OutOfBoundsError` ([#438](#438)) ([1f37e4a](1f37e4a)), closes [#262](#262)
* rename several `Table` methods for consistency ([#445](#445)) ([9954986](9954986)), closes [#439](#439)
* suggest similar columns if column gets accessed that doesnt exist ([#385](#385)) ([6a097a4](6a097a4)), closes [#203](#203)

### Bug Fixes

* added the missing ids in parameterized tests ([#412](#412)) ([dab6419](dab6419)), closes [#362](#362)
* don't warn if `Imputer` transforms column without missing values ([#448](#448)) ([f0cb6a5](f0cb6a5))
* Warnings raised by underlying seaborn and numpy libraries  ([#425](#425)) ([c4143af](c4143af)), closes [#357](#357)
@lars-reimann
Copy link
Member Author

🎉 This issue has been resolved in version 0.15.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lars-reimann lars-reimann added the released Included in a release label Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation 📖 Improvements or additions to documentation enhancement 💡 New feature or request released Included in a release testing 🧪 Additional automated tests
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants