-
Notifications
You must be signed in to change notification settings - Fork 15
Add StdNames #68
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
Add StdNames #68
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great start @ceferisbarov , left a first round of reviews.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #68 +/- ##
==========================================
+ Coverage 92.49% 92.91% +0.42%
==========================================
Files 21 22 +1
Lines 506 536 +30
==========================================
+ Hits 468 498 +30
Misses 38 38 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@juliohm Test set grew too large. I think we can create a function to avoid repeating the same lines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is looking great now @ceferisbarov. I have a final suggestion before we merge this. Can you please replace all tests you have written by simple tests of the form:
@test TableTransforms._camel("apple banana") == "AppleBanana"
@test TableTransforms._snake("apple banana") == "apple_banana"
...
That way we can make sure that we cover various types of strings.
After the above set of tests you can simply add two more tests with tables to make sure that apply
and revert
are working with column and row tables. Also reapply
and isrevertible
.
Co-authored-by: Elias Carvalho <[email protected]>
test/transforms.jl
Outdated
@test TableTransforms._camel("apple_Banana") == "Apple_Banana" | ||
@test TableTransforms._snake("apple_Banana") == "apple_banana" | ||
@test TableTransforms._upper("apple_Banana") == "APPLE_BANANA" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should organize these tests differently. For example, consider the camel case. Your would like to write a list of strings like ["apple banana", "Apple_banana", ...]
and then apply the camel case function to all elements of the list to make sure all results are equal to "AppleBanana"
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@juliohm I am trying something like this now, but I came across an edge case. What should TableTransforms._snake("_A")
return? Do we strip spaces and underscores or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@juliohm I have added some tests with for loop. I am pretty sure I can replace them with @testset
macro, documentation is not clear about syntax. I will add more tests after we agree on syntax and style.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ceferisbarov please request a review whenever you feel that the PR is ready. Attached you can find another round of suggestions.
Co-authored-by: Júlio Hoffimann <[email protected]>
Co-authored-by: Júlio Hoffimann <[email protected]>
Co-authored-by: Júlio Hoffimann <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add tests for columns with special characters such as A-B
, A#
, etc?
Co-authored-by: Júlio Hoffimann <[email protected]>
As I mentioned it should be easy to erase all special symbols as a pre
processing step with a Regex for example. We just need to decide the valids
delimiters. I don't think & is widely used in statistics as a delimiter. It
is used as an interaction term.
Em qua., 11 de mai. de 2022 05:46, Jafar Isbarov ***@***.***>
escreveu:
… ***@***.**** commented on this pull request.
------------------------------
In test/transforms.jl
<#68 (comment)>
:
> + name = "a&B"
+ @test TableTransforms._camel(name) == "A&B"
+ @test TableTransforms._snake(name) == "a&b"
+ @test TableTransforms._upper(name) == "A&B"
+
+ name = "apple-tree"
+ @test TableTransforms._camel(name) == "Apple-tree"
+ @test TableTransforms._snake(name) == "apple-tree"
+ @test TableTransforms._upper(name) == "APPLE-TREE"
+
+ name = "apple#"
+ @test TableTransforms._camel(name) == "Apple#"
+ @test TableTransforms._snake(name) == "apple#"
+ @test TableTransforms._upper(name) == "APPLE#"
I would also suggest adding & to the list of delimiters. That being said,
I don't think we can make this transform work well with complex column
names, anyway. Maybe we can later add more specific transforms that deal
with column names (such as Replace, but for column names). @juliohm
<https://github.com/juliohm> @eliascarv <https://github.com/eliascarv>
—
Reply to this email directly, view it on GitHub
<#68 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZQW3KPSFQ6FR5JIS57RFLVJNXXNANCNFSM5VFQKBEQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we are almost done with this one @ceferisbarov , can you please take a look at this new set of revisions?
Co-authored-by: Júlio Hoffimann <[email protected]>
Co-authored-by: Júlio Hoffimann <[email protected]>
Co-authored-by: Júlio Hoffimann <[email protected]>
@eliascarv anything else I missed before we can merge this? |
For me everything is excellent. |
Another great addition @ceferisbarov ! 🎉 |
I am still trying to make the code more readable. Suggestions are welcome.