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

Improved datetime unit transformer shortcuts - Part 2 #319

Merged
merged 28 commits into from
May 20, 2019

Conversation

crupley
Copy link
Contributor

@crupley crupley commented May 14, 2019

Related issues
Improved datetime unit transformer shortcuts #315
Part 1: #316

Describe the proposed solution
Add additional time period support for map and list date/datetime feature types.

  • TimePeriodMapTransformer
  • TimePeriodListTransformer
  • toTimePeriod shortcuts in Rich-{DateList/DateTimeList/DateMap/DateTimeMap}

Describe alternatives you've considered
None

Additional context
None

@codecov
Copy link

codecov bot commented May 15, 2019

Codecov Report

Merging #319 into master will decrease coverage by 3.82%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #319      +/-   ##
==========================================
- Coverage   86.44%   82.61%   -3.83%     
==========================================
  Files         327      329       +2     
  Lines       10602    10608       +6     
  Branches      336      533     +197     
==========================================
- Hits         9165     8764     -401     
- Misses       1437     1844     +407
Impacted Files Coverage Δ
.../scala/com/salesforce/op/dsl/RichListFeature.scala 100% <100%> (ø) ⬆️
...n/scala/com/salesforce/op/dsl/RichMapFeature.scala 74.32% <100%> (+0.71%) ⬆️
...tages/impl/feature/TimePeriodListTransformer.scala 100% <100%> (ø)
...stages/impl/feature/TimePeriodMapTransformer.scala 100% <100%> (ø)
...alesforce/op/cli/gen/templates/SimpleProject.scala 0% <0%> (-100%) ⬇️
.../scala/com/salesforce/op/cli/gen/ProblemKind.scala 0% <0%> (-100%) ⬇️
...cala/com/salesforce/op/cli/gen/FileInProject.scala 0% <0%> (-100%) ⬇️
...in/scala/com/salesforce/op/cli/CommandParser.scala 0% <0%> (-98.12%) ⬇️
...cala/com/salesforce/op/cli/gen/ProblemSchema.scala 0% <0%> (-96.56%) ⬇️
...src/main/scala/com/salesforce/op/cli/gen/Ops.scala 0% <0%> (-94%) ⬇️
... and 8 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 7886a58...b46f3d8. Read the comment docs.

Copy link
Collaborator

@tovbinm tovbinm left a comment

Choose a reason for hiding this comment

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

lgtm, see some minor comments

uid: String = UID[TimePeriodTransformer[_]]
)(
implicit override val tti: TypeTag[I]
) extends UnaryTransformer[I, OPVector](operationName = "dateToTimePeriod", uid = uid) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

please use a different and distinctive operation name, say dateListToTimePeriod

uid: String = UID[TimePeriodTransformer[_]]
)(
implicit override val tti: TypeTag[I]
) extends UnaryTransformer[I, IntegralMap](operationName = "dateToTimePeriod", uid = uid) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

please use a different and distinctive operation name, say dateMapToTimePeriod

) extends UnaryTransformer[I, OPVector](operationName = "dateToTimePeriod", uid = uid) {

override def transformFn: I => OPVector =
(i: I) => i.value.map(t => period.extractFromTime(t).toDouble).toVector.toOPVector
Copy link
Collaborator

Choose a reason for hiding this comment

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

why i.value.map(t => period.extractFromTime(t).toDouble).toOPVector does not work?

class TimePeriodListTransformer[I <: DateList]
(
val period: TimePeriod,
uid: String = UID[TimePeriodTransformer[_]]
Copy link
Collaborator

Choose a reason for hiding this comment

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

fix uid - UID[TimePeriodListTransformer[_]]

class TimePeriodMapTransformer[I <: DateMap]
(
val period: TimePeriod,
uid: String = UID[TimePeriodTransformer[_]]
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here - fix uid - UID[TimePeriodMapTransformer[_]]

@tovbinm tovbinm merged commit 689b71f into salesforce:master May 20, 2019
This was referenced Jul 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants