Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
kellen committed Aug 22, 2024
1 parent a3d90bf commit 30beea4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
18 changes: 17 additions & 1 deletion beam/src/main/scala/magnolify/beam/unsafe/package.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
/*
* Copyright 2024 Spotify AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package magnolify.beam

import magnolify.shared._
import magnolify.shared.*

package object unsafe {
implicit def afUnsafeEnum[T: EnumType]: BeamSchemaField[UnsafeEnum[T]] =
Expand Down
19 changes: 16 additions & 3 deletions shared/src/main/scala/magnolify/shared/Time.scala
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
/*
* Copyright 2024 Spotify AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package magnolify.shared

import org.joda.time as joda
import java.time.{Duration, Instant, LocalDateTime, LocalTime, ZoneOffset}
import java.util.concurrent.TimeUnit

object Time {
// @inline def microsToMillis(micros: Long): Long = TimeUnit.MICROSECONDS.toMillis(micros)
// @inline def millisToMicros(millis: Long): Long = TimeUnit.MILLISECONDS.toMicros(millis)

// millis /////////////////////////////////////////////////////
@inline def millisToInstant(millisFromEpoch: Long): Instant =
Instant.ofEpochMilli(millisFromEpoch)
Expand Down

0 comments on commit 30beea4

Please sign in to comment.