-
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
Model Deprecation #7562
Merged
Merged
Model Deprecation #7562
Changes from 8 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
7cc1d74
CT-2461: Work toward model deprecation
peterallenwebb 55debbe
CT-2461: Remove unneeded conversions
peterallenwebb 9ca7d37
CT-2461: Fix up unit tests for new fields, correct a couple oversights
peterallenwebb fd88586
CT-2461: Remaining implementation and tests for model/ref deprecation…
peterallenwebb 7842dca
CT-2461: Changelog entry for deprecation warnings
peterallenwebb 37c8361
CT-2461: Refine datetime handling and tests
peterallenwebb ccd73b0
CT-2461: Fix up unit test data
peterallenwebb 8277e8c
CT-2461: Fix some more unit test data.
peterallenwebb 0637591
Merge remote-tracking branch 'origin' into paw/ct-2461-model-deprecation
peterallenwebb d9a4cc2
CT-2461: Fix merge issues
peterallenwebb ed443da
CT-2461: Code review items.
peterallenwebb e64efb1
CT-2461: Improve version -> str conversion
peterallenwebb 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 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: Added warnings for model and ref deprecations | ||
time: 2023-05-09T23:33:29.679333-04:00 | ||
custom: | ||
Author: peterallenwebb | ||
Issue: "7433" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,7 @@ class PublicModel(dbtClassMixin, ManifestOrPublicNode): | |
# list of model unique_ids | ||
public_node_dependencies: List[str] = field(default_factory=list) | ||
generated_at: datetime = field(default_factory=datetime.utcnow) | ||
deprecation_date: Optional[datetime] = None | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✨ |
||
|
||
@property | ||
def is_latest_version(self) -> bool: | ||
|
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
Large diffs are not rendered by default.
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
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.
The Python docs here say the following:
Translating those into code gives something like this.
The slight change suggested below would cover the case where
tzinfo
is notNone
butdt.tzinfo.utcoffset(dt)
returnsNone
.To fully encode the Python datetime definition, I think we'd need to do something like this:
Granted, it might "never" happen for a
tzinfo
object frompytz
to returnNone
for the offset, but I was able to hand construct such atzinfo
object locally.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'd be happy to tighten up this check if you're willing to open the issue. Sorry we didn't get it in v1.