-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Parser no longer takes greedy. Accepts indirect selection, a bool. #4104
Conversation
205b3b5
to
7ce2077
Compare
7ce2077
to
f2b6e65
Compare
@jtcohen6 After some trial and error, Joel and I were able to get every test working except for one involving setting the indirect_selection flag in a yaml selector. We do plan to add a couple more cautious CLI tests in time. But, first, we were unable to find in selector and selector spec the parsing of the yaml file actually takes place. We suspect we need to update the logic in that file. Can you give us a pointer? |
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.
@VersusFacit @joellabes Really nice work!! I love how this has come along.
What do you think of keeping the name and type of this config consistent across the board—from the flag, to the yaml selector property, all the way up to the final expand_selection
method? I find it a bit confusing to switch between the string flag/property and the boolean arg, especially if we envision a future where there could be other modes.
I managed to switch this to use an IndirectSelection
enum: 8f41453. I also snuck a performance boost into incorporate_indirect_nodes
that should shave off a few seconds in large projects, now that indirect selection is eager by default.
Feel free to use, adapt, or toss that code!
@jtcohen6 Burnt some midnight oil and figured out a way to solve this. Tests are working and I added some. The code allows users to add the field to a selector yaml and override whatever the CLI flag may or may not be. Do you want to mix in the changes in that linked sha? Is the total renaming necessary? I almost like the way the predicates flow but you know the structure here better than I. Also, a bit unsure how to address the changelog. |
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.
Thanks for the hard work to see this through!
As long as the end-user behavior is right, and the argument/property names make enough sense to follow through the code, this is as much as we need for now. At such time as we want to swing back through and add a third (or fourth) indirect selection mode, we can lightly refactor as it makes sense. I don't think we need to spend any more time here now.
@VersusFacit As far as the changelog: Could you add a line under the dbt-core 1.0.0 (Release TBD)
> Features
, with a link to the issue + this PR? You can also add yourself + Joel to the list of contributors. As soon as you do that, we can merge and lock this in for v1 :)
After that, there'll just be the matter of updating docs: dbt-labs/docs.getdbt.com#896
else: | ||
raise RuntimeException( | ||
f'indirect_selection value "{indirect_selection}" is not valid!' | ||
) |
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.
A more ergonomic way to do this might be by registering IndirectSelection
as a dataclass, with accepted values and a validation step. That will make more sense in a future where we have more than two indirect selection modes. This works well enough for now.
I want to be sure this change gets in before v1 (especially the switch to the default), so I'm going to add a changelog entry now and merge! |
* Rm unused events, per #4104 * More structured ConcurrencyLine * Replace \n prefixes with EmptyLine * Reimplement ui.warning_tag to centralize logic * Use warning_tag for deprecations too * Rm more unused event types * Exclude EmptyLine from json logs * loglines are not always created by events (#4406) Co-authored-by: Nathaniel May <[email protected]>
* Rm unused events, per #4104 * More structured ConcurrencyLine * Replace \n prefixes with EmptyLine * Reimplement ui.warning_tag to centralize logic * Use warning_tag for deprecations too * Rm more unused event types * Exclude EmptyLine from json logs * loglines are not always created by events (#4406) Co-authored-by: Nathaniel May <[email protected]>
* Rm unused events, per #4104 * More structured ConcurrencyLine * Replace \n prefixes with EmptyLine * Reimplement ui.warning_tag to centralize logic * Use warning_tag for deprecations too * Rm more unused event types * Exclude EmptyLine from json logs * loglines are not always created by events (#4406) Co-authored-by: Nathaniel May <[email protected]>
* A few final logging touch-ups (#4388) * Rm unused events, per #4104 * More structured ConcurrencyLine * Replace \n prefixes with EmptyLine * Reimplement ui.warning_tag to centralize logic * Use warning_tag for deprecations too * Rm more unused event types * Exclude EmptyLine from json logs * loglines are not always created by events (#4406) Co-authored-by: Nathaniel May <[email protected]> * Rollover + backup for dbt.log (#4405) Co-authored-by: Nathaniel May <[email protected]>
* Rm unused events, per #4104 * More structured ConcurrencyLine * Replace \n prefixes with EmptyLine * Reimplement ui.warning_tag to centralize logic * Use warning_tag for deprecations too * Rm more unused event types * Exclude EmptyLine from json logs * loglines are not always created by events (#4406) Co-authored-by: Nathaniel May <[email protected]> automatic commit by git-black, original commits: 8bdaa69 b90ab74
* Rm unused events, per #4104 * More structured ConcurrencyLine * Replace \n prefixes with EmptyLine * Reimplement ui.warning_tag to centralize logic * Use warning_tag for deprecations too * Rm more unused event types * Exclude EmptyLine from json logs * loglines are not always created by events (#4406) Co-authored-by: Nathaniel May <[email protected]> automatic commit by git-black, original commits: b90ab74
…4104) * Parser no longer takes greedy. Accepts indirect selection, a bool. * Remove references to greedy and supporting functions. * 1. Set testing flag default to True. 2. Improve arg parsing. * Update tests and add new case for when flag unset. * Update names and styling to fit test requirements. Add default value for option. * Correct several failing tests now that default behavior was flipped. * Tests expect eager on by default. * All but selector test passing. * Get integration tests working, add them, and mix in selector syntax. * Clean code and correct test. * Add changelog entry Co-authored-by: Mila Page <[email protected]> Co-authored-by: Jeremy Cohen <[email protected]> automatic commit by git-black, original commits: a976e54 e6df426
…4104) * Parser no longer takes greedy. Accepts indirect selection, a bool. * Remove references to greedy and supporting functions. * 1. Set testing flag default to True. 2. Improve arg parsing. * Update tests and add new case for when flag unset. * Update names and styling to fit test requirements. Add default value for option. * Correct several failing tests now that default behavior was flipped. * Tests expect eager on by default. * All but selector test passing. * Get integration tests working, add them, and mix in selector syntax. * Clean code and correct test. * Add changelog entry Co-authored-by: Mila Page <[email protected]> Co-authored-by: Jeremy Cohen <[email protected]> automatic commit by git-black, original commits: e6df426
resolves #4082
Description
This removes the greedy flag and instead adds the indirect-selection flag with eager and cautious as options for which files to pull in as nodes when running tests.
Checklist
CHANGELOG.md
and added information about my change