Skip to content

multi_dots doesn't re-calculate n lengths after exploding #719

Description

@Kevanness

Ran into an issue when using req_url_query(.multi = "explode") with a mix of multi-length and NULL params. It looks like n isn't re-calculated after exploding in multi_dots() on L66 which causes n to be shorter than dots creating a select/recycling issue.

expect_equal(
  multi_dots(a = 1:2, b = NULL, .multi = "explode"),
  list(a = I("1"), a = I("2"), b = NULL)
)

expect_equal(
  multi_dots(a = 1:3, b = NULL, .multi = "explode"),
  list(a = I("1"), a = I("2"), a = I("3"), b = NULL)
)

Since it's using explode, then I would think that n would always have a value of 0 or 1 removing the need of the n > 1 handling for explode. I think it could just have the following for the .multi == "explode" section?

dots <- explode(dots)
n <- lengths(dots)

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