get_code to return concatenated code string and removed format_expression - #206
Merged
Conversation
6 tasks
Contributor
Code Coverage SummaryDiff against mainResults for commit: 848eefb Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Contributor
Contributor
Unit Test Performance DifferenceTest suite performance difference
Additional test case details
Results for commit 4d679c9 ♻️ This comment has been updated with latest results. |
vedhav
self-requested a review
November 28, 2023 01:05
m7pr
reviewed
Nov 28, 2023
vedhav
reviewed
Nov 29, 2023
Co-authored-by: Vedha Viyash <49812166+vedhav@users.noreply.github.com> Signed-off-by: kartikeya kirar <kirar.kartikeya1@gmail.com>
vedhav
approved these changes
Nov 29, 2023
kartikeyakirar
added a commit
to insightsengineering/teal.code
that referenced
this pull request
Nov 29, 2023
…ression` (#176) this fixes #173 In this pull request, I've made updates to both the `get_code` and `replace_code` methods. Now, when the `deparse `arg is set to TRUE, these methods will return a concatenated string. Specifically, the `get_code` method will return character(0) when used with `new_qenv(),` provided no code has been set. As for `replace_code,` it will first split the input string using "\n", then replace the last string in this sequence. Finally, it concatenates these strings again before replacing the code. Removed `format_expression` function. Example ``` q <- new_qenv() get_code(q) # return character(0) replace_code(q, "i <- iris") # @code return character(0) qq <- within(q, i <- iris) qq <- within(qq, m <- mtcars) get_code(qq) # return "i <- iris\nm <- mtcars" replacement <- "i <- mtcars" qr <- replace_code(qq, replacement) get_code(qr) #return "i <- iris\ni <- mtcars" ``` Also review following modules for PR for changes. - [ ] teal insightsengineering/teal#976 - [ ] teal.data insightsengineering/teal.data#206 - [ ] teal.modules.general insightsengineering/teal.modules.general#615 - [ ] teal.modules.clinical insightsengineering/teal.modules.clinical#898 - [ ] teal.goshawk insightsengineering/teal.goshawk#250 - [ ] teal.osprey insightsengineering/teal.osprey#244 --------- Signed-off-by: kartikeya kirar <kirar.kartikeya1@gmail.com> Co-authored-by: Vedha Viyash <49812166+vedhav@users.noreply.github.com>
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.
part of insightsengineering/teal.code#176