-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Detect breaking changes to column names and data types in state:modified check #7216
Merged
Merged
Changes from 24 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
b66beb6
Add state.modified.contract and tests
gshank 14a8e30
Fix unit test
gshank c5b73ec
Update manifest/v9.json for artifact tests
gshank 2f0d6b7
Update artifacts tests. Add reason to exception.
gshank d3a4cf4
first pass at changes before modifying tests
emmyoop edd9261
test updates
emmyoop b028400
add default
emmyoop 7abbf67
update manifest
emmyoop 4ee1a12
fix tests
emmyoop 1cbab4c
changelog
emmyoop 95d112c
fix unit tests
emmyoop 8540fd3
rename strict -> enforced
emmyoop 25be193
Move call to build_contract_checksum, concatenate reasons and update
gshank 9311211
Merge branch 'main' into ct-2038-contract_state_modified
gshank d7ed116
Expand test a bit
gshank 9498809
convert to object
emmyoop c711451
fix tests
emmyoop 8943468
Update Under the Hood-20230217-105223.yaml
emmyoop 20cd0f3
Update Under the Hood-20230217-105223.yaml
emmyoop 520fc40
Rearrange same_contract
gshank 4bf2766
remove stray breakpoints
emmyoop 449aa48
move Contract definition to model_config
emmyoop 8863089
Merge branch 'er/ct-2314-contract-dict' into ct-2038-contract_state_m…
gshank 382f66f
Make changes to use new Contract object
gshank 4f5a5ae
Merge branch 'main' into ct-2038-contract_state_modified
gshank 4b2213a
Fix reference to self.contract in model_config.py
gshank 46ad6d3
Merge branch 'main' into ct-2038-contract_state_modified
gshank File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Features | ||
body: Detect breaking changes to contracts in state:modified check | ||
time: 2023-03-23T13:30:26.593717-04:00 | ||
custom: | ||
Author: gshank | ||
Issue: "6869" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Under the Hood | ||
body: Treat contract config as a python object | ||
time: 2023-02-17T10:52:23.212474-05:00 | ||
custom: | ||
Author: gshank emmyoop | ||
Issue: 6748 7184 |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
Makes sense to leave out constraints for the scope of this issue 👍
We should revisit whether constraints should go in the checksum when we go to implement #7065, where:
ModelContractError
fromsame_contract
False
fromsame_contract
.Determining the nature of a change to a constraint will need additional logic beyond comparing checksums, and adding constraints to the checksum will make understanding changes to column data_type and names a bit trickier. I could see the checksum being a useful to determine, crudely, whether there was a change at all, and needing to actually inspect the columns/constraints more closely to determine the type of change - breaking vs non-breaking.
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.
We could either checks columns individually or have two checksums in the checksum field, one for name/data_type and one for constraints.
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 is the benefit of putting these methods on
CompiledNode
versus carrying the columns onContract
and overriding__eq__()
onContract
(in place ofsame_contract()
)?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.
We are not prepared to move those fields at this time, since it would be a breaking change for packages which use those fields. In addition, not all of the attributes of a column count for breaking changes, so a simple equal doesn't work.