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

Match feature type map hierarchy with regular feature types #49

Merged
merged 7 commits into from
Aug 15, 2018

Conversation

tovbinm
Copy link
Collaborator

@tovbinm tovbinm commented Aug 11, 2018

Related issues
Currently it's not possible to restrict stage types by only numeric maps or only by real maps.

Describe the proposed solution
Update feature type map hierarchy to match the regular feature types hierarchy.
This change allows us restrict stage types by only numeric maps for instance:

// This transformer would allow RealMap, IntegralMap, DateMap etc.
class NumericMapVectorizer[I <: OpMap[_] with NumericMap] extends SequenceTransformer[I, OPVector]

// This transformer would allow RealMap, CurrencyMap and PercentMap only
class NumericMapVectorizer[I <: RealMap] extends SequenceTransformer[I, OPVector]

Additional changes:

  • MultiPickListMap now extends MultiResponse
  • BinaryMap and PickListMap now extend SingleResponse
  • Added NumericMap trait with toDoubleMap: Map[String, Double] (to match the OPNumeric with toDouble: Option[Double])

Describe alternatives you've considered
None.

Additional context
We should have done it from day one.

@tovbinm tovbinm changed the title Update map feature type hierarchy Match feature type map hierarchy with regular feature types Aug 11, 2018
@codecov
Copy link

codecov bot commented Aug 11, 2018

Codecov Report

Merging #49 into master will decrease coverage by 0.9%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #49      +/-   ##
==========================================
- Coverage   85.74%   84.84%   -0.91%     
==========================================
  Files         298      298              
  Lines        9753     9760       +7     
  Branches      329      328       -1     
==========================================
- Hits         8363     8281      -82     
- Misses       1390     1479      +89
Impacted Files Coverage Δ
...scala/com/salesforce/op/features/types/OPMap.scala 100% <ø> (ø) ⬆️
.../scala/com/salesforce/op/features/types/Maps.scala 92.4% <100%> (+0.29%) ⬆️
...ala/com/salesforce/op/features/types/package.scala 52.98% <100%> (+6.06%) ⬆️
...scala/com/salesforce/op/utils/text/TextUtils.scala 0% <0%> (-100%) ⬇️
.../com/salesforce/op/utils/version/VersionInfo.scala 0% <0%> (-100%) ⬇️
...ala/com/salesforce/op/utils/tuples/RichTuple.scala 0% <0%> (-100%) ⬇️
...scala/com/salesforce/op/utils/numeric/Number.scala 0% <0%> (-100%) ⬇️
...om/salesforce/op/utils/spark/OpSparkListener.scala 0% <0%> (-98.71%) ⬇️
...a/com/salesforce/op/utils/date/DateTimeUtils.scala 95.65% <0%> (-4.35%) ⬇️
...es/src/main/scala/com/salesforce/op/OpParams.scala 85.41% <0%> (-4.17%) ⬇️
... and 1 more

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 6a308ad...fffe497. Read the comment docs.

@tovbinm tovbinm merged commit 68ad5a8 into master Aug 15, 2018
@tovbinm tovbinm deleted the mt/types branch August 15, 2018 17:48
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.

None yet

2 participants