Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

fix: set inputs as optional #109

Merged
merged 18 commits into from
Feb 13, 2021
Merged

fix: set inputs as optional #109

merged 18 commits into from
Feb 13, 2021

Conversation

aniketmaurya
Copy link
Contributor

@aniketmaurya aniketmaurya commented Feb 12, 2021

What does this PR do?

categorical_inputs and numerical_inputs are made optional. The error will raise only when both are None.
Fixes #108

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests? [not needed for typos/docs]
  • Did you verify new and existing tests pass locally with your changes?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

PR review

  • Is this pull request ready for review? (if not, please submit in draft mode)

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@codecov
Copy link

codecov bot commented Feb 12, 2021

Codecov Report

Merging #109 (8d03c0d) into master (a4952da) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #109      +/-   ##
==========================================
+ Coverage   86.34%   86.38%   +0.03%     
==========================================
  Files          47       47              
  Lines        1509     1513       +4     
==========================================
+ Hits         1303     1307       +4     
  Misses        206      206              
Flag Coverage Δ
unittests 86.38% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
flash/tabular/classification/data/data.py 85.39% <100.00%> (+0.68%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a4952da...8d03c0d. Read the comment docs.

@kaushikb11
Copy link
Contributor

@aniketmaurya Could you add a test as well for this edge case? It should be able to raise an Exception.

@aniketmaurya
Copy link
Contributor Author

@aniketmaurya Could you add a test as well for this edge case? It should be able to raise an Exception.

Ok will do

@Borda Borda enabled auto-merge (squash) February 12, 2021 09:18
@Borda Borda added the enhancement New feature or request label Feb 12, 2021
@teddykoker teddykoker disabled auto-merge February 12, 2021 19:43
@teddykoker
Copy link
Contributor

Usually it's frowned upon to have empty lists/tuples as default arguments, see: https://nikos7am.com/posts/mutable-default-arguments/

I would make the default values None and pass an empty list if the value is None at runtime instead

Copy link
Contributor

@teddykoker teddykoker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome thanks :)

@kaushikb11 kaushikb11 changed the title set inputs as optional fix: set inputs as optional Feb 13, 2021
@kaushikb11 kaushikb11 enabled auto-merge (squash) February 13, 2021 07:23
@kaushikb11 kaushikb11 merged commit 43b1aa0 into Lightning-Universe:master Feb 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make categorical_input/numerical_input optional for TabularData.from_df
5 participants