-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add function to return details of report script from parsed exprs #129
Conversation
7f7f18f
to
5c7276c
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #129 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 40 40
Lines 3621 3628 +7
=========================================
+ Hits 3621 3628 +7 ☔ View full report in Codecov by Sentry. |
NAMESPACE
Outdated
@@ -4,6 +4,7 @@ S3method(format,orderly_query) | |||
S3method(print,orderly_cleanup_status) | |||
S3method(print,orderly_query_explain) | |||
export(orderly_artefact) | |||
export(orderly_build_script_details) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about calling it orderly_parse()
and have it take arguments of either path
or expr
, then just documenting it as experts use? I can see this being generally useful really
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep I like that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good - minor (I hope) validation suggestions here
R/read.R
Outdated
#' the parsed AST from an orderly script, parses details | ||
#' of any calls to the orderly_ in-script functions into intermediate | ||
#' representation for downstream use. Also validates that any calls to | ||
#' orderly_ in-script functions are well-formed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#' orderly_ in-script functions are well-formed. | |
#' `orderly_*` in-script functions are well-formed. |
R/read.R
Outdated
#' | ||
#' @return Parsed orderly entrypoint script | ||
#' @export | ||
orderly_parse <- function(entrypoint_script, entrypoint_filename) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sold on these argument names (sorry). How about accepting exprs
and filename
. Probably the input needs checking too (so for entrypoint_filename
/ filename
use assert_file_exists
and for entrypoint_script
use assert_is(., "expression")
I think).
You should also check that exactly one of these is given; this is quite annoying to do; you can use missing()
to check that the argument was not given and error if both are !missing()
but this makes it hard to program against sometimes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially put this in but felt kind of gross when chatting through it with Mantra, I've split this into 2 functions now. How does that look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one! i think tiny doc change but otherwise all good
Co-authored-by: M-Kusumgar <[email protected]>
In the runner we want to get the parameters for a report given a name and a hash to run on. So we use git show to see the contents of the file at this point. So we want a way to pass this already read contents into this function to extract the details (so we can look at the parameters)
Struggling to think of a great name for the function here so very open for any suggestions, also wondering if I should do a
@noRd
on this so that we're not advertising this as a function for other people to use?