Fix passing DBI::Id to update_snapshot and dbplyr messages#72
Merged
marcusmunch merged 50 commits intomainfrom Dec 11, 2023
Merged
Fix passing DBI::Id to update_snapshot and dbplyr messages#72marcusmunch merged 50 commits intomainfrom
DBI::Id to update_snapshot and dbplyr messages#72marcusmunch merged 50 commits intomainfrom
Conversation
60029b7 to
c6b9b9a
Compare
Revert changes from 5406fa3
77a25b8 to
7f474f1
Compare
6122409 to
78638e2
Compare
chore: Remove SQLite-specific functions from `get_tables.default`
78638e2 to
e898c27
Compare
RasmusSkytte
approved these changes
Dec 1, 2023
cf41b23 to
cc417ee
Compare
1 task
12c796e to
d8f8f02
Compare
This comment was marked as outdated.
This comment was marked as outdated.
RasmusSkytte
requested changes
Dec 11, 2023
Contributor
RasmusSkytte
left a comment
There was a problem hiding this comment.
Firstly, there a few places where it looks like you have made minor mistakes.
Secondly, I have some general comments, tips etc.
Finally, I have some pedantic comments you can take or leave as you please.
added 10 commits
December 11, 2023 10:56
This change currently has no race condition prevention, and multiple threads calling `log_to_db` simultaneously will therefore crash.
RasmusSkytte
approved these changes
Dec 11, 2023
Contributor
RasmusSkytte
left a comment
There was a problem hiding this comment.
Looks fine to me.
Just need the last check to work, but that should not be an issue.
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.
Intent
This fixes #68.
Additionally, while fixing, I managed to squash all the messages about
in_schemacaused by dbplyr v2.4.0 giving this warning VERY often1.Approach
update_snapshothad some "leaky" logic, not properly catching all cases. Now, the addition ofid.tbl_dbiallows for easy retrieval of a table ID to use onwards. As we now do not expect anydb_tablearguments to not be passable byid, this will catch all valid inputs.Regarding the numerous messages from dbplyr, I hope that they will be changed to a more graceful form, but for now, all calls to
dplyr::tblanddplyr::copy_toin tests and code have been changed to includecheck_from = FALSE.Also, some instances of above messages were caused by the
Loggerunnecessarily copying a data.frame twice in one log update.Known issues
I concede that passing
check_from = FALSEto all calls mentioned above is a somewhat lazy solution. One solution that I thought of just now (and that I could honestly see working better) is to implement some kind of check to see if the caller env is.GlobalEnvand give a warning at most ONCE per session.The current state of
logger$log_to_dbhas no race condition prevention. This is neither introduced nor fixed by this PR, but race condition prevention is an overall topic of #63 and therefore outside the scope of this PR.Checklist
NEWS.md2Footnotes
Naturally, you will not find me missing an opportunity to brag that I managed to identify—and fix—the issue myself. ↩
In order to not mangle
NEWS.mdtoo much, this will be done after v0.2.1 is accepted on CRAN. ↩