Skip to content

tests failures due to complex NA #5748

Description

@jangorecki

We are getting more tests failures due to changed behavior of complex NA.
https://cran.r-project.org/web/checks/check_results_data.table.html

 9 errors out of 9917. Search tests/tests.Rraw for test numbers: 1658.58, 1743.231, 1962.0473, 2040.1, 2040.2, 2060.6, 2060.601, 2060.602, 2060.604.

not fixed on master

sudo docker run -it --rm registry.gitlab.com/jangorecki/dockerfiles/r-devel /bin/bash
wget https://rdatatable.github.io/data.table/src/contrib/data.table_1.14.9.tar.gz
R CMD INSTALL data.table_1.14.9.tar.gz

Looks like complex NA support has to be fixed in:

library(data.table)
test = data.table:::test
DT = data.table(a=1:3, b=list(1:4, c(3.14, 100e10), c(3i,4i,5i)))
DT[ , b := c(1i, -1-1i, NA)]
test(1658.58, fwrite(DT), output='a,b\n1,0\\+1i\n2,-1-1i\n3,$')
#Test 1658.58 did not produce correct output:
#Expected: <<a,b\n1,0\\+1i\n2,-1-1i\n3,$>>
#Observed: <<a,b\n1,0+1i\n2,-1-1i\n3,+0i>>
  • fread: 1743.231
test(1743.231, fread("a,b,c\n2,1,4i", colClasses=list(complex="c", integer=2L), drop="a"), data.table(b=1L, c="4i")) ## + warning
  • fcoalesce: 2060.6, 2060.601, 2060.602, 2060.604
  • shift (again?): 2067.4

Activity

  1. added this to the 1.14.10 milestone on Nov 21, 2023
  2. jangorecki commented on Nov 26, 2023

    @jangorecki
    MemberAuthor

    @MichaelChirico you think you are able to look into this? some of complex NA handling were added by you.

    I think we can adapt fwrite/fread/fcoalesce/shift to new 4.4 behavior and branch those tests to run only 4.4+ so we don't need to test pre 4.4 behavior which is now changing.

  3. MichaelChirico commented on Nov 30, 2023

    @MichaelChirico
    Member

    This will be tough in the near future -- I don't have a dev environment handy where I can easily test C issues.

    I will explore if GitHub Codespaces is suitable, been meaning to try that out.

  4. MichaelChirico commented on Dec 6, 2023

    @MichaelChirico
    Member

    Tests are fixed in #5796, but filed #5797 as a follow-up to ensure we've got good behavior going forward. For now just focused on getting a release out.

  5. jangorecki commented on Dec 6, 2023

    @jangorecki
    MemberAuthor

    This has been solved, both in master and in hotfix branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions