[jira] [Commented] (BEAM-1418) MapElements and FlatMapElements should comply with PTransform style guide
[ https://issues.apache.org/jira/browse/BEAM-1418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15966379#comment-15966379 ] ASF GitHub Bot commented on BEAM-1418: -- Github user asfgit closed the pull request at: https://github.com/apache/beam/pull/2363 > MapElements and FlatMapElements should comply with PTransform style guide > - > > Key: BEAM-1418 > URL: https://issues.apache.org/jira/browse/BEAM-1418 > Project: Beam > Issue Type: Bug > Components: sdk-java-core >Reporter: Eugene Kirpichov >Assignee: Eugene Kirpichov > Labels: backward-incompatible, starter > Fix For: First stable release > > > Type structure of these classes can be improved by slightly changing the API: > FlatMapElements.into(TypeDescriptor).via(as usual). > Likewise for MapElements. This allows getting rid of the awkward > MissingOutputTypeDescriptor intermediate class. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (BEAM-1418) MapElements and FlatMapElements should comply with PTransform style guide
[ https://issues.apache.org/jira/browse/BEAM-1418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15947877#comment-15947877 ] ASF GitHub Bot commented on BEAM-1418: -- GitHub user jkff opened a pull request: https://github.com/apache/beam/pull/2363 [BEAM-1418] MapElements and FlatMapElements should comply with PTransform style guide For both of these classes, we change (Flat)MapElements.via(fn).withOutputType(td) to (Flat)MapElements.into(td).via(fn), which is both shorter and allows getting rid of the ugly intermediate and publicly-visible class MissingOutputTypeDescriptor. R: @bjchambers You can merge this pull request into a Git repository by running: $ git pull https://github.com/jkff/incubator-beam map-style Alternatively you can review and apply these changes as the patch at: https://github.com/apache/beam/pull/2363.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2363 commit c52cddfaf15eb1d5df65bdcbdfb4ee6f167fe0f2 Author: Eugene KirpichovDate: 2017-03-29T20:42:29Z Removes MapElements.MissingOutputTypeDescriptor This comes from changing MapElements.via(fn).withOutputType(td) to MapElements.into(td).via(fn) which is also shorter. commit 6ae80473f9924fe43c18e02f4a139f6421306c7f Author: Eugene Kirpichov Date: 2017-03-29T20:56:00Z Removes FlatMapElements.MissingOutputTypeDescriptor This comes from changing FlatMapElements.via(fn).withOutputType(td) to FlatMapElements.into(td).via(fn) which is also shorter. > MapElements and FlatMapElements should comply with PTransform style guide > - > > Key: BEAM-1418 > URL: https://issues.apache.org/jira/browse/BEAM-1418 > Project: Beam > Issue Type: Bug > Components: sdk-java-core >Reporter: Eugene Kirpichov > Labels: backward-incompatible, starter > Fix For: First stable release > > > Type structure of these classes can be improved by slightly changing the API: > FlatMapElements.into(TypeDescriptor).via(as usual). > Likewise for MapElements. This allows getting rid of the awkward > MissingOutputTypeDescriptor intermediate class. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (BEAM-1418) MapElements and FlatMapElements should comply with PTransform style guide
[ https://issues.apache.org/jira/browse/BEAM-1418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15933138#comment-15933138 ] Ismaël Mejía commented on BEAM-1418: Good point, what a pity! > MapElements and FlatMapElements should comply with PTransform style guide > - > > Key: BEAM-1418 > URL: https://issues.apache.org/jira/browse/BEAM-1418 > Project: Beam > Issue Type: Bug > Components: sdk-java-core >Reporter: Eugene Kirpichov >Assignee: Davor Bonaci > Labels: backward-incompatible, starter > Fix For: First stable release > > > Type structure of these classes can be improved by slightly changing the API: > FlatMapElements.into(TypeDescriptor).via(as usual). > Likewise for MapElements. This allows getting rid of the awkward > MissingOutputTypeDescriptor intermediate class. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (BEAM-1418) MapElements and FlatMapElements should comply with PTransform style guide
[ https://issues.apache.org/jira/browse/BEAM-1418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15932805#comment-15932805 ] Eugene Kirpichov commented on BEAM-1418: It'd be great to get rid of the suffix, but then it would clash with java.lang.Map. It would work for FlatMap though, but then they'd be inconsistent with each other. > MapElements and FlatMapElements should comply with PTransform style guide > - > > Key: BEAM-1418 > URL: https://issues.apache.org/jira/browse/BEAM-1418 > Project: Beam > Issue Type: Bug > Components: sdk-java-core >Reporter: Eugene Kirpichov >Assignee: Davor Bonaci > Labels: backward-incompatible, starter > Fix For: First stable release > > > Type structure of these classes can be improved by slightly changing the API: > FlatMapElements.into(TypeDescriptor).via(as usual). > Likewise for MapElements. This allows getting rid of the awkward > MissingOutputTypeDescriptor intermediate class. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (BEAM-1418) MapElements and FlatMapElements should comply with PTransform style guide
[ https://issues.apache.org/jira/browse/BEAM-1418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15932655#comment-15932655 ] Ismaël Mejía commented on BEAM-1418: Hello, I don't know what do you think about this, but couldn't we also get rid of the 'Elements' suffix? Almost all the other core transforms don't use two words. And then for the via method we can let it like it is, or even better replace it with elements to keep the previous context. This will also eventually help to cover the case of evolving the transform to support Map.values() and Map.keys() as part of the same transform as discussed in BEAM-621. > MapElements and FlatMapElements should comply with PTransform style guide > - > > Key: BEAM-1418 > URL: https://issues.apache.org/jira/browse/BEAM-1418 > Project: Beam > Issue Type: Bug > Components: sdk-java-core >Reporter: Eugene Kirpichov >Assignee: Davor Bonaci > Labels: backward-incompatible, starter > Fix For: First stable release > > > Type structure of these classes can be improved by slightly changing the API: > FlatMapElements.into(TypeDescriptor).via(as usual). > Likewise for MapElements. This allows getting rid of the awkward > MissingOutputTypeDescriptor intermediate class. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (BEAM-1418) MapElements and FlatMapElements should comply with PTransform style guide
[ https://issues.apache.org/jira/browse/BEAM-1418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15903697#comment-15903697 ] Kenneth Knowles commented on BEAM-1418: --- I don't know that it allows getting rid of the intermediate class, just renaming it to {{MissingFunction}}. FWIW I don't find it awkward :-) But if the style guide is to just use one class with nullables and do validation at {{expand}} time you can make that change any time and allow any order of arguments, yes? > MapElements and FlatMapElements should comply with PTransform style guide > - > > Key: BEAM-1418 > URL: https://issues.apache.org/jira/browse/BEAM-1418 > Project: Beam > Issue Type: Bug > Components: sdk-java-core >Reporter: Eugene Kirpichov >Assignee: Davor Bonaci > Labels: backward-incompatible, starter > Fix For: First stable release > > > Type structure of these classes can be improved by slightly changing the API: > FlatMapElements.into(TypeDescriptor).via(as usual). > Likewise for MapElements. This allows getting rid of the awkward > MissingOutputTypeDescriptor intermediate class. -- This message was sent by Atlassian JIRA (v6.3.15#6346)