Skip to content

Commit

Permalink
Remove BlobTypeDescription
Browse files Browse the repository at this point in the history
Signed-off-by: Hongxin Liang <[email protected]>
  • Loading branch information
honnix committed Oct 10, 2023
1 parent 8284ee3 commit cc493fa
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@
import java.util.List;
import java.util.Map;
import org.flyte.api.v1.Blob;
import org.flyte.api.v1.BlobType.BlobDimensionality;
import org.flyte.flytekit.SdkBindingData;
import org.flyte.flytekit.SdkRunnableTask;
import org.flyte.flytekit.jackson.BlobTypeDescription;
import org.flyte.flytekit.jackson.JacksonSdkType;

@AutoService(SdkRunnableTask.class)
Expand All @@ -51,7 +49,6 @@ public abstract static class AutoAllInputsInput {

public abstract SdkBindingData<Duration> d();

@BlobTypeDescription(format = "csv", dimensionality = BlobDimensionality.MULTIPART)
public abstract SdkBindingData<Blob> blob();

public abstract SdkBindingData<List<String>> l();
Expand Down Expand Up @@ -94,7 +91,6 @@ public abstract static class AutoAllInputsOutput {

public abstract SdkBindingData<Duration> d();

@BlobTypeDescription(format = "csv", dimensionality = BlobDimensionality.MULTIPART)
public abstract SdkBindingData<Blob> blob();

public abstract SdkBindingData<List<String>> l();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import org.flyte.flytekit.SdkTypes;
import org.flyte.flytekit.SdkWorkflow;
import org.flyte.flytekit.SdkWorkflowBuilder;
import org.flyte.flytekit.jackson.BlobTypeDescription;
import org.flyte.flytekit.jackson.JacksonSdkType;

@AutoService(SdkWorkflow.class)
Expand Down Expand Up @@ -110,7 +109,6 @@ public abstract static class AllInputsWorkflowOutput {

public abstract SdkBindingData<Duration> d();

@BlobTypeDescription(format = "csv", dimensionality = BlobDimensionality.MULTIPART)
public abstract SdkBindingData<Blob> blob();

public abstract SdkBindingData<List<String>> l();
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.util.Map;
import org.flyte.api.v1.Blob;
import org.flyte.api.v1.BlobType;
import org.flyte.api.v1.BlobType.BlobDimensionality;
import org.flyte.api.v1.Variable;
import org.flyte.flytekit.SdkBindingData;
import org.flyte.flytekit.SdkLiteralType;
Expand Down Expand Up @@ -168,18 +169,11 @@ private SdkLiteralType<?> toLiteralType(

return SdkLiteralTypes.maps(toLiteralType(valueType, false, propName, member));
} else if (Blob.class.isAssignableFrom(type)) {
BlobTypeDescription annotation = member.getAnnotation(BlobTypeDescription.class);
if (annotation == null) {
throw new UnsupportedOperationException(
String.format(
"Field '%s' from class '%s' is declared as '%s' and it must be annotated",
propName, member.getMember().getDeclaringClass().getName(), type));
}
// fixme: create blob type from annotation, or rethink how we could offer the offloaded data
// feature
// https://docs.flyte.org/projects/flytekit/en/latest/generated/flytekit.BlobType.html#flytekit-blobtype
return SdkLiteralTypes.blobs(
BlobType.builder()
.format(annotation.format())
.dimensionality(annotation.dimensionality())
.build());
BlobType.builder().format("").dimensionality(BlobDimensionality.SINGLE).build());
}
// TODO: Support structs
throw new UnsupportedOperationException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import org.flyte.api.v1.Blob;
import org.flyte.api.v1.BlobMetadata;
import org.flyte.api.v1.BlobType;
import org.flyte.api.v1.BlobType.BlobDimensionality;
import org.flyte.api.v1.Literal;
import org.flyte.api.v1.LiteralType;
import org.flyte.api.v1.Primitive;
Expand Down Expand Up @@ -545,7 +544,6 @@ public abstract static class AutoValueInput {

public abstract SdkBindingData<Duration> d();

@BlobTypeDescription(format = "", dimensionality = BlobDimensionality.SINGLE)
public abstract SdkBindingData<Blob> blob();

public abstract SdkBindingData<List<String>> l();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ object SdkScalaType {
implicit def durationLiteralType: SdkScalaLiteralType[Duration] =
DelegateLiteralType(SdkLiteralTypes.durations())

// fixme: create blob type from annotation
// fixme: create blob type from annotation, or rethink how we could offer the offloaded data feature
// https://docs.flyte.org/projects/flytekit/en/latest/generated/flytekit.BlobType.html#flytekit-blobtype
implicit def blobLiteralType: SdkScalaLiteralType[Blob] =
DelegateLiteralType(
SdkLiteralTypes.blobs(
Expand Down

0 comments on commit cc493fa

Please sign in to comment.