salesforce / TransmogrifAI

TransmogrifAI (pronounced trăns-mŏgˈrə-fī) is an AutoML library for building modular, reusable, strongly typed machine learning workflows on Apache Spark with minimal hand-tuning
https://transmogrif.ai
BSD 3-Clause "New" or "Revised" License
2.24k stars 392 forks source link

Fix Days.daysBetween int overflow #471

Closed TuanNguyen27 closed 4 years ago

TuanNguyen27 commented 4 years ago

Days.daysBetween(datetime_1, datetime_2) could throw java.lang.ArithmeticException: Value cannot fit in an int: if the duration between two dates in milliseconds cannot fit a 32-bit int representation. See related Stack Overflow issue here

Describe the proposed solution Switch to using joda's Duration.

Describe alternatives you've considered N/A

Additional context N/A

gerashegalov commented 4 years ago

please add a real PR description

codecov[bot] commented 4 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@275824f). Click here to learn what that means. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #471   +/-   ##
=========================================
  Coverage          ?   86.99%           
=========================================
  Files             ?      345           
  Lines             ?    11622           
  Branches          ?      609           
=========================================
  Hits              ?    10110           
  Misses            ?     1512           
  Partials          ?        0           
Impacted Files Coverage Δ
...ce/op/stages/impl/feature/DateListVectorizer.scala 98.01% <100.00%> (ø)
...force/op/stages/impl/feature/OPMapVectorizer.scala 97.81% <100.00%> (ø)
...a/com/salesforce/op/utils/date/DateTimeUtils.scala 100.00% <100.00%> (ø)
...stages/impl/feature/GeolocationMapVectorizer.scala 100.00% <0.00%> (ø)
.../scala/com/salesforce/op/testkit/DataSources.scala 92.00% <0.00%> (ø)
...ml/jackson/module/scala/OpDefaultScalaModule.scala 100.00% <0.00%> (ø)
...p/stages/impl/feature/SmartTextMapVectorizer.scala 100.00% <0.00%> (ø)
...main/scala/com/salesforce/op/dsl/RichFeature.scala 100.00% <0.00%> (ø)
...com/salesforce/op/testkit/StandardRandomData.scala 100.00% <0.00%> (ø)
...esforce/op/utils/spark/OpVectorColumnHistory.scala 0.00% <0.00%> (ø)
... and 338 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 275824f...3d18626. Read the comment docs.