Skip to content
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

Stop resolution multiplying rows from metadata #380

Merged
merged 2 commits into from
Sep 5, 2024

Conversation

jameslairdsmith
Copy link
Contributor

(Fixes #379)

The metadata column was causing certain rows to recycle over the result data frame. This could happen with any list column that isn't of length one. The solution I created here is to check if the list is not already length one and to wrap it into a list if it is not.

Also added an assertion to force the output into being one row as desired.

Very happy to accept changes as you think is appropriate.

The metadata column was causing certain rows to recycle  over the
result data frame. The solution here is to check if the list is
not already length one and to wrap it into a list if it is not.

Also added an assertion to force the output into being one row
as desired.
@gaborcsardi
Copy link
Member

Thanks! I don't love my old solution of magically fixing bad resolution output. But if we are already doing that, we might as well do it properly.

It seems that

      res$metadata[["RemoteRepos"]] <- config$get("cran-mirror")

converts the metadata character vector to a list silently, that's how we end up with a list.

I am not sure why config$get("cran-mirror") is a list, this can possibly cause other problems as well, so I'll fix that as well.

@gaborcsardi gaborcsardi merged commit 53adef4 into r-lib:main Sep 5, 2024
10 checks passed
@gaborcsardi
Copy link
Member

Thanks again!

gaborcsardi added a commit to r-lib/pak that referenced this pull request Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resolving duplicates rows when requesting version
2 participants