rpkg: dvs_init returns config as a single-row tibble#170
Open
CGMossa wants to merge 2 commits into
Open
Conversation
Member
|
like it! |
Contributor
Author
|
This is a good start, but I would like to try and resolve A2-ai/miniextendr#307 before going further with this. The |
f730176 to
750779b
Compare
2 tasks
750779b to
1c771ba
Compare
5 tasks
Replaces the placeholder list("status" = "initialized") return with a
columnar data frame that flattens dvs::config::Config into atomic
columns:
| compression | metadata_folder_name | backend_path | backend_group |
`Backend::Local(LocalBackend{..})` flattens because Backend already
carries `#[serde(untagged)]`; `cli: Option<CliConfig>` is skipped at
init time via the existing `skip_serializing_if = "Option::is_none"`.
miniextendr's columnar serializer recursively flattens nested structs
into `parent_child` columns, so no view struct is needed.
The R wrapper now wraps the result with `tibble::as_tibble()` for
parity with dvs_add / dvs_get / dvs_status.
Adds ui/main_init.sh exercising the option matrix (defaults, no
compression, custom metadata folder, group, all combined, and the
storage-inside-repo guard) so CLI dvs.toml can be eyeballed against
the R tibble side-by-side.
Adds `init` to ui_names so `just ui-run` / `ui-render` / `ui-publish` pick up ui/main_init.sh and write to ui/output/ui-init.html.
1c771ba to
1f3c91e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AI-written details
Summary
dvs_initpreviously returnedlist(status = "initialized")and printedDVS Initializedto stderr, giving R callers no programmatic view of what was actually configured.Result<List>toResult<ColumnarDataFrame>; builds withvec_to_dataframe(&[config])?. No view struct:Backendalready has#[serde(untagged)], soBackend::Local(LocalBackend{..})flattens transparently intobackend_path/backend_groupvia miniextendr's recursive nested-struct flattening.cli: Option<CliConfig>is skipped at init time by its existingskip_serializing_if = "Option::is_none".invisibleflag and ther_println!("DVS Initialized")line. The printed tibble is now the visible signal.tibble::as_tibble()for parity withdvs_add/dvs_get/dvs_status.ui/main_init.shexercising the option matrix (defaults,--no-compression, custom metadata folder, group, all combined, storage-inside-repo guard) so the CLIdvs.tomlcan be eyeballed alongside the R tibble.justfileincludesinitinui_namessojust ui-publishpicks it up.Test plan
just rpkg-testpasses (cargo + testthat, including the new init tibble test)bash ui/main_init.shruns to completion across all 6 scenarios; CLIdvs.tomlmatches R tibble valuesNotes
metadata_folder_nameis left at its default (None), it appears as a list-column with a singleNULLrather thanNA_character_, because miniextendr's columnar serializer cannot infer the inner type from a bareNone. With any explicit string it's a clean<chr>column. Functional but not pretty; left as follow-up.Drafted by Claude (claude-opus-4-7). Reviewed by the author.