Hydrospheredata / mist

Serverless proxy for Spark cluster
http://hydrosphere.io/mist/
Apache License 2.0
326 stars 68 forks source link

Warning while packaging `SparkContextExample.scala` #467

Closed gowravshekar closed 6 years ago

gowravshekar commented 6 years ago
SparkContextExample.scala:9:13

Adapting argument list by creating a 2-tuple: this may not be what you want.
[warn]         signature: WithArgsScala.withArgs[A, Out](a: A)(implicit tda: mist.api.args.WithArgsScala.ToArgDef.Aux[A,Out]): mist.api.args.ArgDef[Out]
[warn]   given arguments: arg[Seq[Int]]("numbers"), arg[Int]("multiplier", 2)
[warn]  after adaptation: WithArgsScala.withArgs((arg[Seq[Int]]("numbers"), arg[Int]("multiplier", 2)): (mist.api.args.UserArg[Seq[Int]], mist.api.args.UserArg[Int]))
[warn]     withArgs(
[warn]             ^
[warn] one warning found

Similar issues are present upon passing more than 1 argument to withArgs. Any way to pass multiple arguments to withArgs without this warning?

dos65 commented 6 years ago

withArgs method is based on adapted-args feature and if you use -Yno-adapted-args compiler will always warn about that. Also there is another way of composing parameters using &:

(arg[Int]("x") & arg[Int]("y")).onSparkContext((x: Int, y:Int, sc: SparkContext) => ...