Skip to content

Don't use format if ignore_attr = TRUE #134

Closed

Description

@hadley
waldo::compare(factor("a"), 1L, ignore_attr = TRUE)
#> `old`: "a"
#> `new`: "1"

Created on 2022-03-11 by the reprex package (v2.0.1)

Activity

  1. hadley commented on Mar 11, 2022

    @hadley
    MemberAuthor

    And think through numeric comparison issues — maybe don't use format if object is numeric and tolerance is set? See terrainr failure for details.

    Or only show formatted if unclassed fails?

  2. hadley commented on Mar 11, 2022

    @hadley
    MemberAuthor

    But make sure this continues to fail:

    testthat::expect_equal(as.POSIXct("2016-07-18 16:06:06"), as.POSIXct("2016-07-18 16:06:00"))
  3. hadley commented on Mar 11, 2022

    @hadley
    MemberAuthor

    Not sure if that should fail, because it is in within the standard numeric that tolerance that expect_equal() uses.

  4. MichaelChirico commented on Mar 11, 2022

    @MichaelChirico
    Contributor

    from ?all.equal.POSIXt

    The methods for the date-time classes by default allow a tolerance of tolerance = 0.001 seconds, and ignore scale.

  5. hadley commented on Mar 12, 2022

    @hadley
    MemberAuthor

    Hmmmm, not sure how we should replicate that. Maybe it's easiest to preserve the existing (suboptimal) POSIXt behaviour for this release, and tackle in the next one?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions