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

[Beam-9679] Add Core Transforms section / ParDo lesson to the Go SDK katas #11564

Merged

Conversation

damondouglas
Copy link
Contributor

@damondouglas damondouglas commented Apr 29, 2020

This pull request adds a section related to Core Transforms with one Map transforms lesson to the Go SDK katas. It patterns after the existing Java katas:

  • ParDo
  • ParDo OneToMany
  • ParDo struct

I would like to request @henryken and @lostluck to review this pull request. Thank you for allowing me to be part of this project.


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- Build Status --- --- Build Status
Java Build Status Build Status Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status Build Status Build Status
Build Status
Build Status
Python Build Status
Build Status
Build Status
Build Status
--- Build Status
Build Status
Build Status
Build Status
Build Status
--- --- Build Status
XLang --- --- --- Build Status --- --- Build Status

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website
Non-portable Build Status Build Status
Build Status
Build Status Build Status
Portable --- Build Status --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

@lostluck
Copy link
Contributor

Run RAT Precommit

@lostluck
Copy link
Contributor

Run Go Precommit

Copy link
Contributor

@henryken henryken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the addition of the new lessons. I've added some comments.

learning/katas/go/Core Transforms/Map/ParDo/cmd/main.go Outdated Show resolved Hide resolved
learning/katas/go/Core Transforms/Map/MapElements/task.md Outdated Show resolved Hide resolved
@damondouglas
Copy link
Contributor Author

Run RAT Precommit

@damondouglas
Copy link
Contributor Author

Run Go Precommit

Copy link
Contributor

@henryken henryken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Damon for incorporating the changes. Just a few additional minor comments.

@damondouglas
Copy link
Contributor Author

Run RAT Precommit

Copy link
Contributor

@henryken henryken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The learning/katas/go/Core Transforms/Map/ParDo struct/pkg/task/task.go seems to have an issue now.
I suspect the directory needs to be renamed accordingly.

@damondouglas
Copy link
Contributor Author

Thank you @henryken for your patience. I found the course preview function in IntelliJ Edu inconsistent between GoLand and IntelliJ. In my regular testing using GoLand, I load by first closing the project and reopening via navigation to the original folder. If I open the project through any other means in GoLand, when activating the course preview, it seems to pull from a cached source. I haven't completely figured out the issue with GoLand. IntelliJ seems to work as expected.

I deleted the entire ParDo struct and recreated it to ParDo Struct as well as removed my entire src and pkg folder in my $GOHOME. I tested the course preview in both GoLand and IntelliJ and it masks the code using the placeholders where expected.

@lostluck
Copy link
Contributor

lostluck commented May 4, 2020

Retest this please

@lostluck
Copy link
Contributor

lostluck commented May 4, 2020

(sadly, only comitters can trigger the tests even after the first time. Your commands were correct)
I'm doing this review now. Thank you for your patience!

@damondouglas
Copy link
Contributor Author

damondouglas commented May 4, 2020

Retest this please

Is this addressed to me? Would you like me to retest something?

That's "addressed" to the jenkins bot to retest the PR via whatever automated selection of tests it requires. Since the bot is particular, I needed to separate it from my other comment so it would work.

Copy link
Contributor

@lostluck lostluck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only question might be better answred by @henryken : Are the Spaces in the directory names going to cause problems with katas? Are they intended to be like that vs with underscores instead of spaces?

Otherwise, just a few small things, and I can merge this.


<div class="hint">
Use <a href="https://godoc.org/github.com/apache/beam/sdks/go/pkg/beam#ParDo">
ParDo</a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using the qualifed import name, like they'd see in their Go code (eg. beam.ParDo) , rather than just the single method. It would look odd to other languages, but the generally explicit package/provenance of identifiers is a hallmark of Go.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lostluck Do you mean this? If so, I could check across the various tasks of the existing katas to make sure its consistent.

<div class="hint">
  Use <a href="https://godoc.org/github.com/apache/beam/sdks/go/pkg/beam#ParDo">
  beam.ParDo</a>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather, I do. But I can merge this in as is and the change can happen in another PR or it can happen this PR. Whichever you prefer.

Sorry for the delay in getting back to this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created BEAM-9928 so this is not forgotten. My vote is to merge the request.

performs some processing function (your user code) on that element, and emits zero, one, or multiple elements to an
output PCollection.

**Kata:** Please write a simple ParDo that maps the input element by multiplying it by 10.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A possible adjacent task/step is converting a func DoFn into a Structural DoFn. Yes, this is relatively simple, but from a learning standpoint, it makes the distinction pretty clear, while not asking users too much else that might conflate with it. (eg. Getting the wrong idea that funcs must be 1:1 vs 1:many/none, vs structs etc).

Not necessary to do it in this PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lostluck, the space will not create any problem. It is friendlier for the learner to see the lesson and task names in the natural way versus using underscore name.

Co-authored-by: Robert Burke <lostluck@users.noreply.github.com>
Copy link
Contributor

@henryken henryken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM now.

@henryken
Copy link
Contributor

henryken commented May 5, 2020

Please wait for the course uploading before merging this PR.

@damondouglas
Copy link
Contributor Author

@henryken and @lostluck I updated the Stepik course and commited the *-remote-info.yaml files. Thank you both for your help.

@henryken
Copy link
Contributor

henryken commented May 5, 2020

Awesome! This PR can be merged now. Thanks @damondouglas!

@lostluck
Copy link
Contributor

lostluck commented May 7, 2020

Retest this please

@lostluck lostluck merged commit e6fb32e into apache:master May 7, 2020
@lostluck lostluck changed the title [Beam-9679] Add Core Transforms section / Map lesson to the Go SDK katas [Beam-9679] Add Core Transforms section / ParDo lesson to the Go SDK katas May 7, 2020
@damondouglas damondouglas deleted the BEAM-9679-core-transforms-map-kata-go branch May 13, 2020 03:07
yirutang pushed a commit to yirutang/beam that referenced this pull request Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants