Respect integer64= selection when out-of-sample type bumps happen in fread()#7032
Respect integer64= selection when out-of-sample type bumps happen in fread()#7032
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7032 +/- ##
=======================================
Coverage 98.69% 98.69%
=======================================
Files 79 79
Lines 14676 14677 +1
=======================================
+ Hits 14485 14486 +1
Misses 191 191 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Generated via commit ecda6f8 Download link for the artifact containing the test results: ↓ atime-results.zip
|
There was a problem hiding this comment.
Please add some test(s) in inst/tests/tests.Rraw, and be sure to write a NEWS entry.
Also please make note of the tiny tweak to the PR title / description -- mostly this is about respecting quirks of GitHub itself, which doesn't support #NNN issue linking in titles, and does have a nice integration where Closes #NNN will automatically close the issue when the PR is merged.
@oleksiyskononenko are you able to confirm if pydatatable is still maintained / whether this change to readInt64As affects that implementation?
|
I'm sorry, I don't know how to add tests, I'm not familiar with the testing system. |
|
Also, it looks like there are 3 different news files? Which one should I use? |
|
NEWS.x are archival files; The structure of the tests file is pretty simple -- just add new Here's the documentation of https://rdatatable.gitlab.io/data.table/reference/test.html You might search around for other tests of out-of-sample type bumps, and piggy-back off of those. It's acceptable to, e.g., find |
|
@MichaelChirico I'm not involved in |
|
Hi @badasahog I see a NEWS entry, but no tests yet. Let me know if you're stuck. |
|
Sorry for the late response. I don't know how to make tests, I'm not proficient in R, and I don't know how the testing system works. |
|
Writing tests is a required part of OSS contribution. By not writing tests, you're burdening other contributors/the maintainers with doing so on your behalf. I pointed above to the documentation to https://github.com/Rdatatable/data.table/tree/master/.dev You should also feel free to just use the GitHub CI suite -- make changes to tests, push to GitHub, check for GHA failures, iterate. If you're stuck somewhere, we are happy to help, but simply opting out of writing tests won't work. |
| { | ||
| dt0 = data.table(a=seq(10000), b="100") | ||
| dt0[111, b := "1000000000000"] | ||
| f = tempfile() | ||
| fwrite(dt0, f) | ||
|
|
||
| test(1017.3, fread(f, integer64="numeric"), fread(f, colClasses=c("integer", "numeric"))) | ||
| test(1017.4, fread(f, integer64="character"), fread(f, colClasses=c("integer", "character"))) | ||
|
|
||
| unlink(f) | ||
| } |
There was a problem hiding this comment.
Good test, thank you! It fails for me on master and passes on the PR branch. One thing: since R doesn't have variable declarations, the { braces } don't create a new scope; any variables created inside them are fully visible in the outer environment. (The only thing they do is combine multiple expressions, returning the value of the last expression in the group.) The code might as well not create an indentation level at all.
There was a problem hiding this comment.
If you do want to enforce a new scope, you can use local({ ... }). Though we don't really do that in our tests (we should, but that's another issue)

Closes #2749
I also changed
while(true)tofor(;;)for consistency. Technically should've been its own pr, hope you don't mind.