From 3b38139449e9e5e939e9d1685443606189466c16 Mon Sep 17 00:00:00 2001 From: Scala Steward <43047562+scala-steward@users.noreply.github.com> Date: Thu, 26 Dec 2024 17:50:30 +0100 Subject: [PATCH] Update scala3-library to 3.4.1 (#75) * Update scala3-library to 3.4.1 * Regenerate GitHub Actions workflow Executed command: sbt githubWorkflowGenerate * Fix scala source compatibility --------- Co-authored-by: Michael Nedokushev --- .github/workflows/ci.yml | 2 +- .../zio/apache/arrow/core/Tabular.scala | 6 +++--- .../zio/apache/arrow/core/Vector.scala | 4 ++-- .../arrow/core/codec/SchemaEncoderDeriver.scala | 10 +++++----- .../apache/arrow/core/codec/ValueDecoder.scala | 16 ++++++++++------ .../apache/arrow/core/codec/ValueEncoder.scala | 4 ++-- .../arrow/core/codec/ValueVectorCodec.scala | 2 +- .../core/codec/ValueVectorDecoderDeriver.scala | 10 +++++----- .../arrow/core/codec/ValueVectorEncoder.scala | 2 +- .../core/codec/ValueVectorEncoderDeriver.scala | 10 +++++----- .../arrow/core/codec/VectorSchemaRootCodec.scala | 2 +- .../codec/VectorSchemaRootDecoderDeriver.scala | 12 ++++++------ .../core/codec/VectorSchemaRootEncoder.scala | 2 +- .../codec/VectorSchemaRootEncoderDeriver.scala | 12 ++++++------ .../zio/apache/arrow/core/codec/package.scala | 2 +- .../zio/apache/arrow/core/ipc/package.scala | 4 ++-- .../zio/apache/arrow/core/TabularSpec.scala | 2 +- .../zio/apache/arrow/core/VectorSpec.scala | 2 +- .../zio/apache/arrow/core/codec/CodecSpec.scala | 2 +- .../arrow/core/codec/SchemaEncoderSpec.scala | 2 +- .../zio/apache/arrow/core/ipc/IpcSpec.scala | 2 +- .../apache/arrow/datafusion/DataframeSpec.scala | 2 +- project/BuildHelper.scala | 10 +++++++++- 23 files changed, 67 insertions(+), 55 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e29f50..2914ee0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - scala: [2.12.20, 2.13.15, 3.3.4] + scala: [2.12.20, 2.13.15, 3.4.1] java: [temurin@11, temurin@17] runs-on: ${{ matrix.os }} steps: diff --git a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/Tabular.scala b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/Tabular.scala index dc49fcf..9d08fa6 100644 --- a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/Tabular.scala +++ b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/Tabular.scala @@ -13,7 +13,7 @@ object Tabular { def empty[A: ZSchema](implicit schemaEncoder: SchemaEncoder[A] - ): RIO[Scope with BufferAllocator, VectorSchemaRoot] = + ): RIO[Scope & BufferAllocator, VectorSchemaRoot] = ZIO.fromAutoCloseable( ZIO.serviceWithZIO[BufferAllocator] { implicit alloc => for { @@ -31,7 +31,7 @@ object Tabular { def fromChunk[A: ZSchema: SchemaEncoder](chunk: Chunk[A])(implicit encoder: VectorSchemaRootEncoder[A] - ): RIO[Scope with BufferAllocator, VectorSchemaRoot] = + ): RIO[Scope & BufferAllocator, VectorSchemaRoot] = for { root <- empty _ <- encoder.encodeZIO(chunk, root) @@ -39,7 +39,7 @@ object Tabular { def fromStream[R, A: ZSchema: SchemaEncoder](stream: ZStream[R, Throwable, A])(implicit encoder: VectorSchemaRootEncoder[A] - ): RIO[R with Scope with BufferAllocator, VectorSchemaRoot] = + ): RIO[R & Scope & BufferAllocator, VectorSchemaRoot] = for { chunk <- stream.runCollect root <- fromChunk(chunk) diff --git a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/Vector.scala b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/Vector.scala index f41ce1b..24eea06 100644 --- a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/Vector.scala +++ b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/Vector.scala @@ -12,7 +12,7 @@ object Vector { new FromChunkPartiallyApplied[V] final class FromChunkPartiallyApplied[V <: ValueVector](private val dummy: Boolean = true) extends AnyVal { - def apply[A](chunk: Chunk[A])(implicit encoder: ValueVectorEncoder[V, A]): RIO[Scope with BufferAllocator, V] = + def apply[A](chunk: Chunk[A])(implicit encoder: ValueVectorEncoder[V, A]): RIO[Scope & BufferAllocator, V] = encoder.encodeZIO(chunk) } @@ -22,7 +22,7 @@ object Vector { final class FromStreamPartiallyApplied[V <: ValueVector](private val dummy: Boolean = true) extends AnyVal { def apply[R, A]( stream: ZStream[R, Throwable, A] - )(implicit encoder: ValueVectorEncoder[V, A]): RIO[R with Scope with BufferAllocator, V] = + )(implicit encoder: ValueVectorEncoder[V, A]): RIO[R & Scope & BufferAllocator, V] = for { chunk <- stream.runCollect vec <- fromChunk(chunk) diff --git a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/SchemaEncoderDeriver.scala b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/SchemaEncoderDeriver.scala index b7d41ed..f96da53 100644 --- a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/SchemaEncoderDeriver.scala +++ b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/SchemaEncoderDeriver.scala @@ -14,7 +14,7 @@ object SchemaEncoderDeriver { override def deriveRecord[A]( record: Schema.Record[A], - fields: => Chunk[Deriver.WrappedF[SchemaEncoder, _]], + fields: => Chunk[Deriver.WrappedF[SchemaEncoder, ?]], summoned: => Option[SchemaEncoder[A]] ): SchemaEncoder[A] = new SchemaEncoder[A] { @@ -46,7 +46,7 @@ object SchemaEncoderDeriver { override def deriveEnum[A]( `enum`: Schema.Enum[A], - cases: => Chunk[Deriver.WrappedF[SchemaEncoder, _]], + cases: => Chunk[Deriver.WrappedF[SchemaEncoder, ?]], summoned: => Option[SchemaEncoder[A]] ): SchemaEncoder[A] = new SchemaEncoder[A] { @@ -143,7 +143,7 @@ object SchemaEncoderDeriver { } override def deriveSequence[C[_], A]( - sequence: Schema.Sequence[C[A], A, _], + sequence: Schema.Sequence[C[A], A, ?], inner: => SchemaEncoder[A], summoned: => Option[SchemaEncoder[C[A]]] ): SchemaEncoder[C[A]] = new SchemaEncoder[C[A]] { @@ -167,8 +167,8 @@ object SchemaEncoderDeriver { override def deriveTransformedRecord[A, B]( record: Schema.Record[A], - transform: Schema.Transform[A, B, _], - fields: => Chunk[Deriver.WrappedF[SchemaEncoder, _]], + transform: Schema.Transform[A, B, ?], + fields: => Chunk[Deriver.WrappedF[SchemaEncoder, ?]], summoned: => Option[SchemaEncoder[B]] ): SchemaEncoder[B] = new SchemaEncoder[B] { diff --git a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/ValueDecoder.scala b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/ValueDecoder.scala index dd7ae3d..a45866e 100644 --- a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/ValueDecoder.scala +++ b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/ValueDecoder.scala @@ -19,17 +19,21 @@ trait ValueDecoder[+A] { object ValueDecoder { private[codec] def decodeStruct[V0 <: ValueVector, A]( - fields: Chunk[Schema.Field[A, _]], - decoders: Chunk[ValueDecoder[_]], + fields: Chunk[Schema.Field[A, ?]], + decoders: Chunk[ValueDecoder[?]], reader: FieldReader, vec: V0, idx: Int ): DynamicValue = { - val values = ListMap(fields.zip(decoders).map { case (field, decoder) => - val value: DynamicValue = decoder.decodeValue(Some(field.name), reader, vec, idx) + val values = ListMap( + fields + .zip(decoders) + .map { case (field, decoder) => + val value: DynamicValue = decoder.decodeValue(Some(field.name), reader, vec, idx) - field.name.toString -> value - }: _*) + field.name.toString -> value + } * + ) DynamicValue.Record(TypeId.Structural, values) } diff --git a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/ValueEncoder.scala b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/ValueEncoder.scala index f76763d..89e6700 100644 --- a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/ValueEncoder.scala +++ b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/ValueEncoder.scala @@ -23,8 +23,8 @@ object ValueEncoder { private[codec] def encodeStruct[A]( value: A, - fields: Chunk[Schema.Field[A, _]], - encoders: Chunk[ValueEncoder[_]], + fields: Chunk[Schema.Field[A, ?]], + encoders: Chunk[ValueEncoder[?]], writer: FieldWriter )(implicit alloc: BufferAllocator): Unit = { diff --git a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/ValueVectorCodec.scala b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/ValueVectorCodec.scala index 9a0d04b..a17dac5 100644 --- a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/ValueVectorCodec.scala +++ b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/ValueVectorCodec.scala @@ -17,7 +17,7 @@ final case class ValueVectorCodec[V <: ValueVector, A]( def decode(vec: V): Either[Throwable, Chunk[A]] = decoder.decode(vec) - def encodeZIO(chunk: Chunk[A]): RIO[Scope with BufferAllocator, V] = + def encodeZIO(chunk: Chunk[A]): RIO[Scope & BufferAllocator, V] = encoder.encodeZIO(chunk) def encode(chunk: Chunk[A])(implicit alloc: BufferAllocator): Either[Throwable, V] = diff --git a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/ValueVectorDecoderDeriver.scala b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/ValueVectorDecoderDeriver.scala index 1390198..1820b94 100644 --- a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/ValueVectorDecoderDeriver.scala +++ b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/ValueVectorDecoderDeriver.scala @@ -12,7 +12,7 @@ object ValueVectorDecoderDeriver { override def deriveRecord[A]( record: Schema.Record[A], - fields: => Chunk[Deriver.WrappedF[ValueVectorDecoder[V1, *], _]], + fields: => Chunk[Deriver.WrappedF[ValueVectorDecoder[V1, *], ?]], summoned: => Option[ValueVectorDecoder[V1, A]] ): ValueVectorDecoder[V1, A] = new ValueVectorDecoder[V1, A] { @@ -80,7 +80,7 @@ object ValueVectorDecoderDeriver { override def deriveEnum[A]( `enum`: Schema.Enum[A], - cases: => Chunk[Deriver.WrappedF[ValueVectorDecoder[V1, *], _]], + cases: => Chunk[Deriver.WrappedF[ValueVectorDecoder[V1, *], ?]], summoned: => Option[ValueVectorDecoder[V1, A]] ): ValueVectorDecoder[V1, A] = ??? @@ -117,7 +117,7 @@ object ValueVectorDecoderDeriver { } override def deriveSequence[C[_], A]( - sequence: Schema.Sequence[C[A], A, _], + sequence: Schema.Sequence[C[A], A, ?], inner: => ValueVectorDecoder[V1, A], summoned: => Option[ValueVectorDecoder[V1, C[A]]] ): ValueVectorDecoder[V1, C[A]] = new ValueVectorDecoder[V1, C[A]] { @@ -193,8 +193,8 @@ object ValueVectorDecoderDeriver { override def deriveTransformedRecord[A, B]( record: Schema.Record[A], - transform: Schema.Transform[A, B, _], - fields: => Chunk[Deriver.WrappedF[ValueVectorDecoder[V1, *], _]], + transform: Schema.Transform[A, B, ?], + fields: => Chunk[Deriver.WrappedF[ValueVectorDecoder[V1, *], ?]], summoned: => Option[ValueVectorDecoder[V1, B]] ): ValueVectorDecoder[V1, B] = ??? diff --git a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/ValueVectorEncoder.scala b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/ValueVectorEncoder.scala index 2996061..00ac452 100644 --- a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/ValueVectorEncoder.scala +++ b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/ValueVectorEncoder.scala @@ -12,7 +12,7 @@ import scala.util.control.NonFatal trait ValueVectorEncoder[V <: ValueVector, -A] extends ValueEncoder[A] { self => - final def encodeZIO(chunk: Chunk[A]): RIO[Scope with BufferAllocator, V] = + final def encodeZIO(chunk: Chunk[A]): RIO[Scope & BufferAllocator, V] = ZIO.fromAutoCloseable( ZIO.serviceWithZIO[BufferAllocator] { implicit alloc => ZIO.fromEither(encode(chunk)) diff --git a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/ValueVectorEncoderDeriver.scala b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/ValueVectorEncoderDeriver.scala index ecbc9d9..c10d06a 100644 --- a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/ValueVectorEncoderDeriver.scala +++ b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/ValueVectorEncoderDeriver.scala @@ -14,7 +14,7 @@ object ValueVectorEncoderDeriver { override def deriveRecord[A]( record: Schema.Record[A], - fields: => Chunk[Deriver.WrappedF[ValueVectorEncoder[V1, *], _]], + fields: => Chunk[Deriver.WrappedF[ValueVectorEncoder[V1, *], ?]], summoned: => Option[ValueVectorEncoder[V1, A]] ): ValueVectorEncoder[V1, A] = new ValueVectorEncoder[V1, A] { @@ -56,7 +56,7 @@ object ValueVectorEncoderDeriver { override def deriveEnum[A]( `enum`: Schema.Enum[A], - cases: => Chunk[Deriver.WrappedF[ValueVectorEncoder[V1, *], _]], + cases: => Chunk[Deriver.WrappedF[ValueVectorEncoder[V1, *], ?]], summoned: => Option[ValueVectorEncoder[V1, A]] ): ValueVectorEncoder[V1, A] = ??? @@ -159,7 +159,7 @@ object ValueVectorEncoderDeriver { } override def deriveSequence[C[_], A]( - sequence: Schema.Sequence[C[A], A, _], + sequence: Schema.Sequence[C[A], A, ?], inner: => ValueVectorEncoder[V1, A], summoned: => Option[ValueVectorEncoder[V1, C[A]]] ): ValueVectorEncoder[V1, C[A]] = @@ -205,8 +205,8 @@ object ValueVectorEncoderDeriver { override def deriveTransformedRecord[A, B]( record: Schema.Record[A], - transform: Schema.Transform[A, B, _], - fields: => Chunk[Deriver.WrappedF[ValueVectorEncoder[V1, *], _]], + transform: Schema.Transform[A, B, ?], + fields: => Chunk[Deriver.WrappedF[ValueVectorEncoder[V1, *], ?]], summoned: => Option[ValueVectorEncoder[V1, B]] ): ValueVectorEncoder[V1, B] = ??? diff --git a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/VectorSchemaRootCodec.scala b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/VectorSchemaRootCodec.scala index ebc68cb..b8fecad 100644 --- a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/VectorSchemaRootCodec.scala +++ b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/VectorSchemaRootCodec.scala @@ -16,7 +16,7 @@ final case class VectorSchemaRootCodec[A]( def decode(root: VectorSchemaRoot): Either[Throwable, Chunk[A]] = decoder.decode(root) - def encodeZIO(chunk: Chunk[A], root: VectorSchemaRoot): RIO[Scope with BufferAllocator, VectorSchemaRoot] = + def encodeZIO(chunk: Chunk[A], root: VectorSchemaRoot): RIO[Scope & BufferAllocator, VectorSchemaRoot] = encoder.encodeZIO(chunk, root) def encode( diff --git a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/VectorSchemaRootDecoderDeriver.scala b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/VectorSchemaRootDecoderDeriver.scala index 14c26c7..d46b855 100644 --- a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/VectorSchemaRootDecoderDeriver.scala +++ b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/VectorSchemaRootDecoderDeriver.scala @@ -14,7 +14,7 @@ object VectorSchemaRootDecoderDeriver { override def deriveRecord[A]( record: Schema.Record[A], - fields: => Chunk[Deriver.WrappedF[VectorSchemaRootDecoder, _]], + fields: => Chunk[Deriver.WrappedF[VectorSchemaRootDecoder, ?]], summoned: => Option[VectorSchemaRootDecoder[A]] ): VectorSchemaRootDecoder[A] = new VectorSchemaRootDecoder[A] { @@ -40,7 +40,7 @@ object VectorSchemaRootDecoderDeriver { val value = decoder.decodeField(reader, vec, idx) name.toString -> value - }: _*) + } *) DynamicValue.Record(TypeId.Structural, values).toTypedValue(record) match { case Right(v) => @@ -69,7 +69,7 @@ object VectorSchemaRootDecoderDeriver { override def deriveEnum[A]( `enum`: Schema.Enum[A], - cases: => Chunk[Deriver.WrappedF[VectorSchemaRootDecoder, _]], + cases: => Chunk[Deriver.WrappedF[VectorSchemaRootDecoder, ?]], summoned: => Option[VectorSchemaRootDecoder[A]] ): VectorSchemaRootDecoder[A] = ??? @@ -105,7 +105,7 @@ object VectorSchemaRootDecoderDeriver { } override def deriveSequence[C[_], A]( - sequence: Schema.Sequence[C[A], A, _], + sequence: Schema.Sequence[C[A], A, ?], inner: => VectorSchemaRootDecoder[A], summoned: => Option[VectorSchemaRootDecoder[C[A]]] ): VectorSchemaRootDecoder[C[A]] = new VectorSchemaRootDecoder[C[A]] { @@ -138,8 +138,8 @@ object VectorSchemaRootDecoderDeriver { override def deriveTransformedRecord[A, B]( record: Schema.Record[A], - transform: Schema.Transform[A, B, _], - fields: => Chunk[Deriver.WrappedF[VectorSchemaRootDecoder, _]], + transform: Schema.Transform[A, B, ?], + fields: => Chunk[Deriver.WrappedF[VectorSchemaRootDecoder, ?]], summoned: => Option[VectorSchemaRootDecoder[B]] ): VectorSchemaRootDecoder[B] = ??? diff --git a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/VectorSchemaRootEncoder.scala b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/VectorSchemaRootEncoder.scala index 16ef648..0bda273 100644 --- a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/VectorSchemaRootEncoder.scala +++ b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/VectorSchemaRootEncoder.scala @@ -11,7 +11,7 @@ import scala.util.control.NonFatal trait VectorSchemaRootEncoder[-A] extends ValueEncoder[A] { self => - final def encodeZIO(chunk: Chunk[A], root: VectorSchemaRoot): RIO[Scope with BufferAllocator, VectorSchemaRoot] = + final def encodeZIO(chunk: Chunk[A], root: VectorSchemaRoot): RIO[Scope & BufferAllocator, VectorSchemaRoot] = ZIO.fromAutoCloseable( ZIO.serviceWithZIO[BufferAllocator] { implicit alloc => ZIO.fromEither(encode(chunk, root)) diff --git a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/VectorSchemaRootEncoderDeriver.scala b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/VectorSchemaRootEncoderDeriver.scala index 868a417..79d3c7d 100644 --- a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/VectorSchemaRootEncoderDeriver.scala +++ b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/VectorSchemaRootEncoderDeriver.scala @@ -14,14 +14,14 @@ object VectorSchemaRootEncoderDeriver { override def deriveRecord[A]( record: Schema.Record[A], - fields: => Chunk[Deriver.WrappedF[VectorSchemaRootEncoder, _]], + fields: => Chunk[Deriver.WrappedF[VectorSchemaRootEncoder, ?]], summoned: => Option[VectorSchemaRootEncoder[A]] ): VectorSchemaRootEncoder[A] = new VectorSchemaRootEncoder[A] { private val encoders = fields.map(_.unwrap) private def encodeField0[A1]( - encoder: VectorSchemaRootEncoder[_], + encoder: VectorSchemaRootEncoder[?], value: A1, writer: FieldWriter )(implicit @@ -86,7 +86,7 @@ object VectorSchemaRootEncoderDeriver { override def deriveEnum[A]( `enum`: Schema.Enum[A], - cases: => Chunk[Deriver.WrappedF[VectorSchemaRootEncoder, _]], + cases: => Chunk[Deriver.WrappedF[VectorSchemaRootEncoder, ?]], summoned: => Option[VectorSchemaRootEncoder[A]] ): VectorSchemaRootEncoder[A] = ??? @@ -130,7 +130,7 @@ object VectorSchemaRootEncoderDeriver { } override def deriveSequence[C[_], A]( - sequence: Schema.Sequence[C[A], A, _], + sequence: Schema.Sequence[C[A], A, ?], inner: => VectorSchemaRootEncoder[A], summoned: => Option[VectorSchemaRootEncoder[C[A]]] ): VectorSchemaRootEncoder[C[A]] = new VectorSchemaRootEncoder[C[A]] { @@ -160,8 +160,8 @@ object VectorSchemaRootEncoderDeriver { override def deriveTransformedRecord[A, B]( record: Schema.Record[A], - transform: Schema.Transform[A, B, _], - fields: => Chunk[Deriver.WrappedF[VectorSchemaRootEncoder, _]], + transform: Schema.Transform[A, B, ?], + fields: => Chunk[Deriver.WrappedF[VectorSchemaRootEncoder, ?]], summoned: => Option[VectorSchemaRootEncoder[B]] ): VectorSchemaRootEncoder[B] = ??? diff --git a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/package.scala b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/package.scala index 348ffea..c6adea3 100644 --- a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/package.scala +++ b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/codec/package.scala @@ -8,7 +8,7 @@ import zio.schema.StandardType package object codec { - def primitiveWriter(st: StandardType[_], vec: FieldVector): FieldWriter = + def primitiveWriter(st: StandardType[?], vec: FieldVector): FieldWriter = (st, vec) match { case (StandardType.StringType, vec0: VarCharVector) => new VarCharWriterImpl(vec0) diff --git a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/ipc/package.scala b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/ipc/package.scala index 8f9f042..bb3c451 100644 --- a/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/ipc/package.scala +++ b/modules/core/src/main/scala/me/mnedokushev/zio/apache/arrow/core/ipc/package.scala @@ -16,7 +16,7 @@ package object ipc { in: InputStream )(implicit decoder: VectorSchemaRootDecoder[A] - ): ZStream[Scope with BufferAllocator, Throwable, A] = + ): ZStream[Scope & BufferAllocator, Throwable, A] = for { (reader, root) <- ZStream .fromZIO( @@ -45,7 +45,7 @@ package object ipc { batchSize: Int = 2048 )(implicit encoder: VectorSchemaRootEncoder[A] - ): ZIO[R with Scope with BufferAllocator, Throwable, ByteArrayOutputStream] = { + ): ZIO[R & Scope & BufferAllocator, Throwable, ByteArrayOutputStream] = { val out = new ByteArrayOutputStream() for { diff --git a/modules/core/src/test/scala/me/mnedokushev/zio/apache/arrow/core/TabularSpec.scala b/modules/core/src/test/scala/me/mnedokushev/zio/apache/arrow/core/TabularSpec.scala index b80eadf..d18b340 100644 --- a/modules/core/src/test/scala/me/mnedokushev/zio/apache/arrow/core/TabularSpec.scala +++ b/modules/core/src/test/scala/me/mnedokushev/zio/apache/arrow/core/TabularSpec.scala @@ -8,7 +8,7 @@ import zio.test._ object TabularSpec extends ZIOSpecDefault { - override def spec: Spec[TestEnvironment with Scope, Any] = + override def spec: Spec[TestEnvironment & Scope, Any] = suite("Tabular")( test("empty") { ZIO.scoped( diff --git a/modules/core/src/test/scala/me/mnedokushev/zio/apache/arrow/core/VectorSpec.scala b/modules/core/src/test/scala/me/mnedokushev/zio/apache/arrow/core/VectorSpec.scala index 508dae4..48566df 100644 --- a/modules/core/src/test/scala/me/mnedokushev/zio/apache/arrow/core/VectorSpec.scala +++ b/modules/core/src/test/scala/me/mnedokushev/zio/apache/arrow/core/VectorSpec.scala @@ -9,7 +9,7 @@ import zio.test._ object VectorSpec extends ZIOSpecDefault { - override def spec: Spec[TestEnvironment with Scope, Any] = + override def spec: Spec[TestEnvironment & Scope, Any] = suite("Vector")( test("fromChunk") { val payload = Chunk(1, 2, 3) diff --git a/modules/core/src/test/scala/me/mnedokushev/zio/apache/arrow/core/codec/CodecSpec.scala b/modules/core/src/test/scala/me/mnedokushev/zio/apache/arrow/core/codec/CodecSpec.scala index a4ce5be..052644f 100644 --- a/modules/core/src/test/scala/me/mnedokushev/zio/apache/arrow/core/codec/CodecSpec.scala +++ b/modules/core/src/test/scala/me/mnedokushev/zio/apache/arrow/core/codec/CodecSpec.scala @@ -110,7 +110,7 @@ object CodecSpec extends ZIOSpecDefault { Derive.derive[VectorSchemaRootDecoder, Summoned0](VectorSchemaRootDecoderDeriver.summoned) } - override def spec: Spec[TestEnvironment with Scope, Any] = + override def spec: Spec[TestEnvironment & Scope, Any] = suite("Codec")( valueVectorDecoderSpec, valueVectorEncoderSpec, diff --git a/modules/core/src/test/scala/me/mnedokushev/zio/apache/arrow/core/codec/SchemaEncoderSpec.scala b/modules/core/src/test/scala/me/mnedokushev/zio/apache/arrow/core/codec/SchemaEncoderSpec.scala index c9ad4b3..e64667b 100644 --- a/modules/core/src/test/scala/me/mnedokushev/zio/apache/arrow/core/codec/SchemaEncoderSpec.scala +++ b/modules/core/src/test/scala/me/mnedokushev/zio/apache/arrow/core/codec/SchemaEncoderSpec.scala @@ -12,7 +12,7 @@ import scala.jdk.CollectionConverters._ object SchemaEncoderSpec extends ZIOSpecDefault { - override def spec: Spec[TestEnvironment with Scope, Any] = + override def spec: Spec[TestEnvironment & Scope, Any] = suite("SchemaEncoder")( encodeFlatSpec ) diff --git a/modules/core/src/test/scala/me/mnedokushev/zio/apache/arrow/core/ipc/IpcSpec.scala b/modules/core/src/test/scala/me/mnedokushev/zio/apache/arrow/core/ipc/IpcSpec.scala index bfca06a..9db2885 100644 --- a/modules/core/src/test/scala/me/mnedokushev/zio/apache/arrow/core/ipc/IpcSpec.scala +++ b/modules/core/src/test/scala/me/mnedokushev/zio/apache/arrow/core/ipc/IpcSpec.scala @@ -10,7 +10,7 @@ import zio.test._ import java.io.ByteArrayInputStream object IpcSpec extends ZIOSpecDefault { - override def spec: Spec[TestEnvironment with Scope, Any] = + override def spec: Spec[TestEnvironment & Scope, Any] = suite("IPC")( test("streaming") { val payload = (1 to 8096).map(i => Primitives(i, i.toDouble, i.toString)) diff --git a/modules/datafusion/src/test/scala/me/mnedokushev/zio/apache/arrow/datafusion/DataframeSpec.scala b/modules/datafusion/src/test/scala/me/mnedokushev/zio/apache/arrow/datafusion/DataframeSpec.scala index 8f5e11a..aabc9cd 100644 --- a/modules/datafusion/src/test/scala/me/mnedokushev/zio/apache/arrow/datafusion/DataframeSpec.scala +++ b/modules/datafusion/src/test/scala/me/mnedokushev/zio/apache/arrow/datafusion/DataframeSpec.scala @@ -22,7 +22,7 @@ object DataframeSpec extends ZIOSpecDefault { } - override def spec: Spec[TestEnvironment with Scope, Any] = + override def spec: Spec[TestEnvironment & Scope, Any] = suite("Dataframe")( test("collect") { ZIO.serviceWithZIO[Context] { context => diff --git a/project/BuildHelper.scala b/project/BuildHelper.scala index 191960f..29cb383 100644 --- a/project/BuildHelper.scala +++ b/project/BuildHelper.scala @@ -10,6 +10,7 @@ object BuildHelper { libraryDependencies ++= betterMonadicFor(scalaVersion.value), libraryDependencies ++= kindProjector(scalaVersion.value), scalacOptions --= disableUnusedImportsWarnings(scalaVersion.value), + scalacOptions ++= source3Compatibility(scalaVersion.value), semanticdbEnabled := true, semanticdbVersion := scalafixSemanticdb.revision, Test / javaOptions ++= arrowJavaCompat, @@ -18,7 +19,7 @@ object BuildHelper { val Scala212 = "2.12.20" val Scala213 = "2.13.15" - val Scala3 = "3.3.4" + val Scala3 = "3.4.1" private def betterMonadicFor(scalaVersion: String) = CrossVersion.partialVersion(scalaVersion) match { @@ -45,4 +46,11 @@ object BuildHelper { case _ => Seq() } + // See https://www.scala-lang.org/api/3.x/docs/docs/reference/changed-features/vararg-splices.html#compatibility-considerations-2 + private def source3Compatibility(scalaVersion: String) = + CrossVersion.partialVersion(scalaVersion) match { + case Some((2, _)) => Seq("-Xsource:3") + case _ => Seq() + } + }