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

Feature Request: ?global? object for spec file #44

Closed
5 tasks
bms63 opened this issue Jun 30, 2022 · 6 comments · Fixed by #107
Closed
5 tasks

Feature Request: ?global? object for spec file #44

bms63 opened this issue Jun 30, 2022 · 6 comments · Fixed by #107
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@bms63
Copy link
Collaborator

bms63 commented Jun 30, 2022

Background

IS there a way to make my adds_spec file into some type of object that the xportr_ functions can access without have to call it over and over again.

Have:

 adds %>% 
  select(adds_spec$variable) %>% 
  xportr_order(adds_spec) %>% 
  xportr_label(adds_spec) %>% 
  xportr_format(adds_spec)

want:

 adds %>% 
  select(adds_spec$variable) %>% 
  xportr_order() %>% 
  xportr_label() %>% 
  xportr_format()

I've seen you all do some skulduggery awesomeness with R so wondering if this is something we can set up for users or show users how to do in an articel. @elimillera

Proposal

See #16 (comment)

We discussed folding in an additional aspect with this issue: reducing duplication of arguments in a pipeline. Right now, the metadata and possibly the domain must be specified at every step of a pipeline. The goal I have in mind is to be able to run something like this:

adsl_data %>%
xportr_set(metadata_obj, optional_domain) %>%
xportr_type() %>%
xportr_length() %>%
...etc.`

Questions

  • How to reduce burden on user?
  • Warnings and Errors when not used properly

Definition of Done

  • Create function that reduces burden of repetitive entries in xportr functions
  • Downstream functions are not impacted, i.e. xportr_ functions can be used without this function
  • Unit Tests created and documentation written
@bms63 bms63 moved this to Backlog in xportr 0.3.0 Apr 13, 2023
@elimillera elimillera added the enhancement New feature or request label Apr 13, 2023
@elimillera
Copy link
Member

Possible idea: Attach metadata to object in 'xportr' calls

@bms63
Copy link
Collaborator Author

bms63 commented May 2, 2023

This is sort of similar to @EeethB proposal in #16. If we want this update, shall shall we use this for the creating the function? I think the other issue that has the proposal is a bit different.

@EeethB
Copy link
Collaborator

EeethB commented May 2, 2023

Yes 🤦 I did not notice there was a separate issue for this part. Thanks for pointing it out!

@EeethB EeethB moved this from Backlog to In Progress in xportr 0.3.0 May 2, 2023
@vedhav
Copy link
Collaborator

vedhav commented May 2, 2023

Yesss! This is a great idea.
Since different xportr_* functions use different specs (xportr_order uses ds_vars specs while the xportr_label uses var_spec) I like the idea of xportr_set() to set all the metadata in one place.

My question is, Does it make the life of the end user easier if we ask them to set all the metadata at once?
Because currently, users have the flexibility to use xportr with just var specs and not worry about other specs (if they don't plan to use other specs). As I don't use this in my work I'm not sure of things like this and the overhead associated with setting all the metadata at once.

Of course, we can make the xportr_set() more robust to work with partial spec and throw errors when a particular function is run without the required spec set by the xportr_set(). And, this seems like a good way to group all the spec-related functions and doc together which is super clean so I'm all in for this :)

@bms63 bms63 added this to the xportr 0.3.0 milestone May 2, 2023
@bms63
Copy link
Collaborator Author

bms63 commented May 2, 2023

@elimillera Since we have the people-power right now - I added this to the Milestone for xportr 3.0 release

@bms63
Copy link
Collaborator Author

bms63 commented May 2, 2023

@atorus-research/xportr-development-team Hi all, I spruced up this issue a bit. @EeethB hoping you are still wanting to tackle this one! :)

@EeethB EeethB linked a pull request May 8, 2023 that will close this issue
13 tasks
@elimillera elimillera moved this from In Progress to In Review in xportr 0.3.0 May 9, 2023
bms63 added a commit that referenced this issue May 21, 2023
Merge remote-tracking branch 'origin/44-pipe-metadata' into 84_xportr_deep_dive_vignette

# Conflicts:
#	NEWS.md
vedhav added a commit that referenced this issue May 25, 2023
@vedhav vedhav closed this as completed May 25, 2023
@github-project-automation github-project-automation bot moved this from In Review to Done in xportr 0.3.0 May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants