Skip to content
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

[CT-2260] [Feature] Explainable state modified #7109

Open
3 tasks done
z3z1ma opened this issue Mar 2, 2023 · 2 comments
Open
3 tasks done

[CT-2260] [Feature] Explainable state modified #7109

z3z1ma opened this issue Mar 2, 2023 · 2 comments
Labels
enhancement New feature or request help_wanted Trickier changes, with a clear starting point, good for previous/experienced contributors node selection Functionality and syntax for selecting DAG nodes state: modified state Stateful selection (state:modified, defer)

Comments

@z3z1ma
Copy link
Contributor

z3z1ma commented Mar 2, 2023

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could not find an existing issue for this feature
  • I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion

Describe the feature

Problem:
I want to be able to explain a state:modified selection with fine grained diffs. I can code up a lot of ways to solve this but let me riff on what I think would be ideal.

Solution:
There are methods returning primitive types that should ideally be wrapper types that duck-type the effect of the primitive. Specifically, the methods I am calling out are planted all over the sort-of core dataclasses, and they return bools when, in an ideal world, they should return a specific class which implements __bool__ but is, by effect of not being a binary primitive, significantly more extensible. We can do this whilst maintaining the contract with dependents of the method.

All of the same_* methods from same_body to same_database_representation
These should pass around a Comparator which has a baked in method called output diff which leverages difflib to generate a log-able diff of the node. This means Comparator's will carry references to old and new, so that it is available as needed. And lastly, the diff is opt-in based on where we decide to plant the method calls. I can see the -vv verbosity level being the impetus to output the diff.

Describe alternatives you've considered

So long as the same_* methods are restricted to bools, there is no alternative.

Who will this benefit?

Anyone troubleshooting why a model is running when they don't think or know if it was modified by providing a highly detailed unified_diff.

Are you interested in contributing this feature?

Yes

Anything else?

Slack Thread: https://getdbt.slack.com/archives/C50NEBJGG/p1675216311733109

@z3z1ma z3z1ma added enhancement New feature or request triage labels Mar 2, 2023
@github-actions github-actions bot changed the title [Feature] Explainable state modified [CT-2260] [Feature] Explainable state modified Mar 2, 2023
@jtcohen6 jtcohen6 added help_wanted Trickier changes, with a clear starting point, good for previous/experienced contributors state Stateful selection (state:modified, defer) node selection Functionality and syntax for selecting DAG nodes Team:Language and removed triage labels Mar 2, 2023
@jtcohen6
Copy link
Contributor

jtcohen6 commented Mar 2, 2023

Thanks for opening the issue @z3z1ma! I know folks will be excited about this :)

(Internal note: Even though this has to do with node selection, which is generally Team:Execution, the changes will largely be in updates to our node classes, so Team:Language feels like the better fit.)

@z3z1ma
Copy link
Contributor Author

z3z1ma commented Mar 2, 2023

In progress PR: #7102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help_wanted Trickier changes, with a clear starting point, good for previous/experienced contributors node selection Functionality and syntax for selecting DAG nodes state: modified state Stateful selection (state:modified, defer)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants