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

Remove free function aggregation with feature builders #311

Merged
merged 3 commits into from
May 9, 2019

Conversation

tovbinm
Copy link
Collaborator

@tovbinm tovbinm commented May 9, 2019

Related issues
Allowing arbitrary function aggregation prevents us from implementing serialization for FeatureGeneratorStage instances required in #274

Describe the proposed solution
Remove free function aggregation with feature builders

Describe alternatives you've considered
NA

Additional context
Users can still add custom aggregators using objects of classes as follows:

val survivedResponse = FeatureBuilder.Binary[Passenger]
    .extract(_.survived.toBinary)
    .aggregate(MyAggr)
    .asResponse

object MyAggr extends CustomMonoidAggregator[Binary](zero = ..., associativeFn = ...)
// or
class MyAggr() extends CustomMonoidAggregator[Binary](zero = ..., associativeFn = ...)

the old syntax wont work anymore:

// not supported anymore
val survivedResponse = FeatureBuilder.Binary[Passenger]
    .extract(_.survived.toBinary)
    .aggregate(zero = ..., associativeFn = ...)
    .asResponse

// not supported anymore
val survivedResponse = FeatureBuilder.Binary[Passenger]
    .extract(_.survived.toBinary)
    .aggregate(associativeFn = ...)
    .asResponse

Copy link
Contributor

@wsuchy wsuchy left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov
Copy link

codecov bot commented May 9, 2019

Codecov Report

Merging #311 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #311      +/-   ##
=========================================
+ Coverage   86.48%   86.5%   +0.01%     
=========================================
  Files         322     322              
  Lines       10583   10579       -4     
  Branches      347     564     +217     
=========================================
- Hits         9153    9151       -2     
+ Misses       1430    1428       -2
Impacted Files Coverage Δ
...sforce/op/aggregators/CustomMonoidAggregator.scala 100% <ø> (ø) ⬆️
...la/com/salesforce/op/features/FeatureBuilder.scala 32.85% <ø> (-1.41%) ⬇️
...com/salesforce/op/test/PassengerFeaturesTest.scala 100% <100%> (ø) ⬆️
...es/src/main/scala/com/salesforce/op/OpParams.scala 89.79% <0%> (+4.08%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b6bc25a...58508ae. Read the comment docs.

@tovbinm tovbinm merged commit 2081d5e into master May 9, 2019
@tovbinm tovbinm deleted the mt/no-custom-aggr branch May 9, 2019 22:10
This was referenced Jul 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants