Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@
package org.flyte.flytekit
Copy link
Member Author

Choose a reason for hiding this comment

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

BTW why these classes are not under flytekitscala package?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

We cannot make it protected either as it would
  * be good for the own object but both implementations deal with list or maps
  * of [[SdkBindingData]] and therefore cannot call this method because it is in
  * a different class.

Not sure I understand what this refers to.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I understand what this means.

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried revising it a bit in a latter commit.


import org.flyte.api.v1.BindingData
import org.flyte.flytekit.SdkBindingData.Literal
import org.flyte.flytekitscala.SdkLiteralTypes.collections

import java.util.function
import scala.collection.JavaConverters._

private[flyte] class BindingCollection[T](
private[flyte] case class BindingCollection[T](
elementType: SdkLiteralType[T],
bindingCollection: List[SdkBindingData[T]]
) extends SdkBindingData[List[T]] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@
package org.flyte.flytekit

import org.flyte.api.v1.BindingData
import org.flyte.flytekit.SdkBindingData.Literal
import org.flyte.flytekitscala.SdkLiteralTypes.maps

import java.util.function
import scala.collection.JavaConverters._

private[flyte] class BindingMap[T](
private[flyte] case class BindingMap[T](
valuesType: SdkLiteralType[T],
bindingMap: Map[String, SdkBindingData[T]]
) extends SdkBindingData[Map[String, T]] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ package org.flyte

/** Contains subclasses for [[SdkBindingData]]. We are forced to define this
* package here because [[SdkBindingData#idl()]] is package private (we don´t
* want to expose it to users). We cannot make it protected either as it would
* be good for the own object but both implementations deal with list or maps
* of [[SdkBindingData]] and therefore cannot call this method because it is in
* a different class.
* want to expose it to users). Making it protected doesn't help either because
* list or map needs to call this method of elements so that requires it to be
* public.
*
* This is not ideal because we are splitting the flytekit package in two maven
* modules. This would create problems when we decide to add java 9 style
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ object SdkBindingDataFactory {
elementType: SdkLiteralType[T],
elements: List[SdkBindingData[T]]
): SdkBindingData[List[T]] = {
new BindingCollection(elementType, elements)
BindingCollection(elementType, elements)
}

/** Creates a [[SdkBindingData]] for a flyte map given a java
Expand All @@ -372,7 +372,7 @@ object SdkBindingDataFactory {
valuesType: SdkLiteralType[T],
valueMap: Map[String, SdkBindingData[T]]
): SdkBindingData[Map[String, T]] =
new BindingMap(valuesType, valueMap)
BindingMap(valuesType, valueMap)

private def toSdkLiteralType(
value: Any,
Expand Down