-
Notifications
You must be signed in to change notification settings - Fork 55
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 tests for @select
and @transform
#155
Conversation
Okay I think this is ready for review. Remaining tests are
|
CI fails |
Sorry, |
test/dataframes.jl
Outdated
cr = "c" | ||
|
||
@testset "@transform" begin | ||
@test @transform(df, n = :i).n == df.i |
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.
in several tests I would also check:
- if the original
df
was not changed - if columns got copied (
!==
) and not just aliased (===
) - not only the transformed column but if all other columns are retained
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.
Same for other macros
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.
if columns got copied (
!==
) and not just aliased (===
)
It looks like that is not actually the behavior
julia> df = DataFrame(rand(2,2));
julia> @transform(df, n = :x1).n === df.x1
true
Presumably this is not actually behavior we want, so this goes in the limits of
testset. Do you agree?
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.
Yes - for sure we want @tranform
to make a copy like transform
, as this is the expected behavior (so I would put the current tests in the set of tests that are likely to be broken after the update).
In general we might consider adding copycols
kwarg to @transform
but this can be left for later.
Nice tests - I have tried to check that you have not removed any old tests and it seems so, but just please confirm that this is the case. |
udev 16295320 0 16295320 0% /dev tmpfs 3264564 1916 3262648 1% /run /dev/sda5 212873684 100856764 101133800 50% / tmpfs 16322804 838960 15483844 6% /dev/shm tmpfs 5120 4 5116 1% /run/lock tmpfs 16322804 0 16322804 0% /sys/fs/cgroup /dev/loop1 1024 1024 0 100% /snap/gnome-logs/93 /dev/loop2 69248 69248 0 100% /snap/sublime-text/77 /dev/loop3 261760 261760 0 100% /snap/gnome-3-34-1804/33 /dev/loop4 69248 69248 0 100% /snap/sublime-text/85 /dev/loop5 267008 267008 0 100% /snap/kde-frameworks-5-core18/32 /dev/loop8 2560 2560 0 100% /snap/gnome-calculator/748 /dev/loop6 384 384 0 100% /snap/gnome-characters/550 /dev/loop7 56320 56320 0 100% /snap/core18/1880 /dev/loop0 164096 164096 0 100% /snap/gnome-3-28-1804/116 /dev/loop10 6528 6528 0 100% /snap/rclone/466 /dev/loop11 261760 261760 0 100% /snap/gnome-3-34-1804/36 /dev/loop9 2304 2304 0 100% /snap/gnome-system-monitor/148 /dev/loop13 56320 56320 0 100% /snap/core18/1754 /dev/loop12 9344 9344 0 100% /snap/canonical-livepatch/95 /dev/loop14 384 384 0 100% /snap/gnome-characters/539 /dev/loop16 20352 20352 0 100% /snap/okular/90 /dev/loop18 20224 20224 0 100% /snap/okular/98 /dev/loop17 165376 165376 0 100% /snap/gnome-3-28-1804/128 /dev/loop15 2560 2560 0 100% /snap/gnome-calculator/730 /dev/loop19 99328 99328 0 100% /snap/core/9665 /dev/loop20 1024 1024 0 100% /snap/gnome-logs/100 /dev/loop21 98944 98944 0 100% /snap/core/9436 /dev/loop22 63616 63616 0 100% /snap/gtk-common-themes/1506 /dev/loop24 2304 2304 0 100% /snap/gnome-system-monitor/145 /dev/loop23 297600 297600 0 100% /snap/kde-frameworks-5-qt-5-14-core18/4 /dev/loop25 296832 296832 0 100% /snap/kde-frameworks-5-qt-5-14-core18/3 /dev/loop27 9344 9344 0 100% /snap/canonical-livepatch/94 /dev/loop26 56192 56192 0 100% /snap/gtk-common-themes/1502 /dev/sda2 98304 33475 64829 35% /boot/efi tmpfs 3264560 124 3264436 1% /run/user/1000 in local scope
Okay i've pinned down some I can confirm that I didnt delete any tests. Just moved a lot of things. |
Bumping this. Would be great to get this merged so we can make real changes to |
Sure - but can you please resolve merge conflicts first and make sure all tests are correct against current master (without it I am not able to merge this). Thank you! |
Looks good to me. |
Tests fail. I will look into this today. |
Tests pass! Ready for merging |
Thank you! |
Now the real work begins! |
In preparation of using
DataFrames.transform
behind the scenes, I am writing a bunch of tests to@test_throws
so we know exactly when we are adding new behavior or fixing current bugs.Please feel free to add tests as you see fit.