-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[BEAM-121] Add display data to ParDo transforms #125
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
Conversation
|
R: @bjchambers |
|
|
||
| @Override | ||
| public void populateDisplayData(DisplayData.Builder builder) { | ||
| Filter.populateDisplayData(builder, String.format("x ≤ %s", value)); |
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.
@davorbonaci for comments on using unicode in the codebase. I'm not sure if we should care.
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.
Note also this'll get serialized as JSON and passed into the service. I don't see any reason we shouldn't support Unicode..
|
Conflicts blocking test run(s). |
| Bound<String, String> parDo = ParDo.of(fn); | ||
|
|
||
| DisplayData displayData = DisplayData.from(parDo); | ||
| assertThat(displayData, includes(fn)); |
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.
Maybe add some messages here? Every time I see these tests, I expect to see something like "and make sure the fnMetadata" is there, then I need to find this and parse it.
assertThat("Copies over all data from the function", displayData, includes(fn));
Might make it easier to parse the assertions.
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 see where you're coming from. I'd prefer to make the Matcher method self-describing rather than require a comment on each usage. Maybe something like:
assertThat(displayData, includesDisplayDataFrom(fn));
Let me take this as a follow-up item once the pending PRs go through in order to avoid merge conflicts. Tracking in BEAM-195
e71de00 to
a01229b
Compare
|
I've addressed all feedback so far. Please take another look. @bjchambers |
a01229b to
fa16dc8
Compare
| .build() | ||
| ); | ||
|
|
||
| ImmutableSet<ImmutableMap<String, Object>> expectedFn2DisplayData = ImmutableSet.of( |
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 shouldn't need to change anymore -- the Matcher based version should work, right?
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 is the version that existed in my branch before mergepocolypse. It includes a few more fields which are now being serialized, and is also a stronger assertion in that it is testing for set equality rather than subset.
|
LGTM. |
|
Backported via GoogleCloudPlatform/DataflowJavaSDK#216 |
#! Stabilize sort-test
Be sure to do all of the following to help us incorporate your contribution
quickly and easily:
[BEAM-<Jira issue #>] Description of pull requestmvn clean verify. (Even better, enableTravis-CI on your fork and ensure the whole test matrix passes).
number, if there is one.
Individual Contributor License Agreement.