-
Notifications
You must be signed in to change notification settings - Fork 103
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
Paste no longer works in the test version #9207
Comments
@rdstern this bug was there for long. I check in version 0.7.17 and I get the same error. I guess @Patowhiz has worked on the |
@Patowhiz I did a quick check on chatgpt and the issue arises in the loop where you're trying to replace values in the selected columns. Specifically, when you assign new_values <- clip_tbl[, index], new_values is a vector, and if you later use it directly in a conditional check, it will lead to the mentioned error. If you agree with code below, then someone in the team can update it? Reads passed clipboard data and saves it to the selected data frameDataSheet$set("public", "paste_from_clipboard", function(col_names, start_row_pos = 1, first_clip_row_is_header = FALSE, clip_board_text) { Get the clipboard text contents as a data frameclip_tbl <- clipr::read_clip_tbl(x = clip_board_text, header = first_clip_row_is_header) Get the selected data framecurrent_tbl <- self$get_data_frame(use_current_filter = FALSE) Check if copied data rows are more than current data rowsif (nrow(clip_tbl) > nrow(current_tbl)) { If column names are missing, then just add the clip data as new columns and quit functionif (missing(col_names)) { For existing column namesCheck if the number of copied columns and selected columns are equalif (ncol(clip_tbl) != length(col_names)) { Check copied data integrityfor (index in seq_along(col_names)) { Replace values in the selected columnsfor (index in seq_along(col_names)) {
} # End for loop
|
@Vitalis95 has a lot on his plat just now. He is preparing tables stuff for @Patowhiz as well as finalising the 2/3 way summaries. I suggest @Patowhiz should be able to fix this quickly as he wrote it originally. |
@N-thony @rdstern, thank you for raising this issue. @rdstern, in summary, this error is due to the R upgrade, which causes certain older code implementations to throw errors. As I've mentioned before, R and its packages should be carefully evaluated with each upgrade, including reviewing documentation for any breaking changes. I hope the detailed explanations below demonstrate a balanced approach, encouraging both caution and progress when it comes to R-Instat development. I recommend a thorough evaluation of this issue, as I am uncertain about how other parts of our R code base might be affected. @N-thony, the lines in question were last worked on in 2022 and merged (after testing) into version 0.7.6, the last stable release. In that version, this functionality worked, so I was surprised it stopped functioning. @rdstern and @N-thony, I suggest cross-referencing recent bugs with version 0.7.6, which underwent strict reviews, with minimal bugs and regressions. This is the version I revert to whenever I encounter issues with recent changes. @N-thony, your ChatGPT response is partially correct, and its solution will resolve the problem. However, it misses the broader context, likely due to the information it was given. I hope this comment helps clarify that broader issue. As I've emphasised before, debugging with RStudio saves time. I often use it to troubleshoot R-related issues, helping other developers by pinpointing the exact problems. As shown in the screenshot below, this bug originates from the Within I’m unsure if there are other parts of our code that use |
@N-thony so-far-so-good on the test version.
I have been writing the help on your undo and it is working well.
Now I have found the first bug and that is that the paste operation no longer seems to work.
I tried in diamonds, and then survey, just copying 3 cells from a single column and pasting them lower down into the same column. By the way the warning may have to change, because (when it works) I assume and hope, when it works that it can now be undone>
Anyway now I get this error:
So there is a problem now in the data_book$paste_from_clipboard function to be fixed!
I know this gives you new work, but in a way I'm quite pleased - this is what our testing is all about!!!
The text was updated successfully, but these errors were encountered: