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.
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
feat: Activate Version with example test #89
feat: Activate Version with example test #89
Changes from 2 commits
e25b99d
3280b01
43dc675
c433682
b367081
f908796
2ba215b
fff8458
67989b3
e3fad47
42441da
f40ba63
aacbed1
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Boolean should be generated as True / False here I think? I'll leave for now
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.
Agreed. Very strange that it shows defaults of
0
. Agreed though we don't need to block on this.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.
I think we could take this function and just drop it into the SDK as it is here, this just has a few tweaks that are needed to make this work in a more generic way
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.
I'm a little worried about what would happen if someone ran this in production with
add_record_metadata
set to True for a while, then suddenly they change it toFalse
.I think we'd end up dropping the entire table, because we'd add all the new records, then none of them would have a
new_version
set they'd all be NULL. Then we'd drop all the NULLs. :ORemoving the IS NULL check would work here but I think the better thing to do would be a check to be sure metadata_columns is enabled as I think the IS NULL check is very valid here as in normal operation you want activate_version to be keeping your data very "clean" and in the same shape as the source.
I should also write a test for this case as it's potentially scary (only place in our code that we drop tables so being cautious is good)
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.
If we fix the other issue https://github.com/MeltanoLabs/target-postgres/pull/89/files#r1084618420 I believe this one gets solved as well.