-
Notifications
You must be signed in to change notification settings - Fork 167
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
[#1466] Filter intersection of tags #1467
base: main
Are you sure you want to change the base?
[#1466] Filter intersection of tags #1467
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
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.
Sorry that this went under the radar for so long! It just needs a sync and a few nits, then we can get this in.
@@ -10,6 +10,7 @@ option go_package = "github.com/dataform-co/dataform/protos/dataform"; | |||
message RunConfig { | |||
repeated string actions = 1; | |||
repeated string tags = 5; | |||
bool include_all_tags = 10; |
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.
"include all" is ambiguous in semantic meaning - IMO something like filterTagsAsIntersection
would be better as it's more explicit.
expect(actionNames).includes("schema.op_e"); | ||
expect(actionNames).includes("schema.tab_a"); | ||
expect(actionNames).not.includes("schema.op_a"); | ||
expect(actionNames).not.includes("schema.op_b"); | ||
expect(actionNames).not.includes("schema.op_c"); | ||
expect(actionNames).not.includes("schema.op_d"); |
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.
This would be better as expect(actionNames).deep.equals(["schema.op_e", "schema.op_a"]);
allActions | ||
.filter(action => action.tags.some(tag => runConfig.tags.includes(tag))) | ||
.forEach(action => includedActionNames.add(targetAsReadableString(action.target))); | ||
// Keep actions wich include every tags in --tag option |
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.
// Keep actions wich include every tags in --tag option | |
// Select actions which match the intersection of the set of tags. |
.filter(action => runConfig.tags.every(tag => action.tags.includes(tag))) | ||
.forEach(action => includedActionNames.add(targetAsReadableString(action.target))); | ||
} | ||
// Keep actions with include at least one tag in --tag option |
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.
// Keep actions with include at least one tag in --tag option | |
// Select actions which match the union of the set of tags. |
Hello,
I added a new flag
--include-all-tags
that works with--tags
options to get the behavior requested in #1466Default flag value is set to false to keep existing behavior unchanged