Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
Signed-off-by: Katrina Rogan <[email protected]>
  • Loading branch information
katrogan committed Jan 12, 2024
1 parent c883c78 commit fc16f16
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import (
"strconv"
"strings"

"github.com/golang/protobuf/proto"

"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/datacatalog"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog"
Expand Down Expand Up @@ -140,7 +138,6 @@ func GenerateDatasetIDForTask(ctx context.Context, k catalog.Key) (*datacatalog.
Domain: k.Identifier.Domain,
Name: getDatasetNameFromTask(k.Identifier),
Version: datasetVersion,
Org: k.Identifier.Org,
}
return datasetID, nil
}
Expand All @@ -160,7 +157,6 @@ const (
execProjectKey = "exec-project"
execNodeIDKey = "exec-node"
execTaskAttemptKey = "exec-attempt"
execOrgKey = "exec-org"
)

// Understanding Catalog Identifiers
Expand Down Expand Up @@ -191,7 +187,6 @@ func GetArtifactMetadataForSource(taskExecutionID *core.TaskExecutionIdentifier)
execNameKey: taskExecutionID.NodeExecutionId.GetExecutionId().GetName(),
execNodeIDKey: taskExecutionID.NodeExecutionId.GetNodeId(),
execTaskAttemptKey: strconv.Itoa(int(taskExecutionID.GetRetryAttempt())),
execOrgKey: taskExecutionID.GetNodeExecutionId().GetExecutionId().GetOrg(),
},
}
}
Expand All @@ -214,19 +209,21 @@ func GetSourceFromMetadata(datasetMd, artifactMd *datacatalog.Metadata, currentI
return nil, fmt.Errorf("failed to parse [%v] to integer. Error: %w", val, err)
}

taskID := proto.Clone(&currentID).(*core.Identifier)
taskID.Version = GetOrDefault(datasetMd.KeyMap, taskVersionKey, "unknown")

return &core.TaskExecutionIdentifier{
TaskId: taskID,
TaskId: &core.Identifier{
ResourceType: currentID.ResourceType,
Project: currentID.Project,
Domain: currentID.Domain,
Name: currentID.Name,
Version: GetOrDefault(datasetMd.KeyMap, taskVersionKey, "unknown"),
},
RetryAttempt: uint32(attempt),
NodeExecutionId: &core.NodeExecutionIdentifier{
NodeId: GetOrDefault(artifactMd.KeyMap, execNodeIDKey, "unknown"),
ExecutionId: &core.WorkflowExecutionIdentifier{
Project: GetOrDefault(artifactMd.KeyMap, execProjectKey, currentID.GetProject()),
Domain: GetOrDefault(artifactMd.KeyMap, execDomainKey, currentID.GetDomain()),
Name: GetOrDefault(artifactMd.KeyMap, execNameKey, "unknown"),
Org: GetOrDefault(artifactMd.KeyMap, execOrgKey, currentID.GetOrg()),
},
},
}, nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ func TestGetArtifactMetadataForSource(t *testing.T) {
execDomainKey: tID.NodeExecutionId.ExecutionId.Domain,
execNodeIDKey: tID.NodeExecutionId.NodeId,
execNameKey: tID.NodeExecutionId.ExecutionId.Name,
execOrgKey: tID.NodeExecutionId.ExecutionId.Org,
}},
}
for _, tt := range tests {
Expand Down

0 comments on commit fc16f16

Please sign in to comment.