<#3071 Return StructuredDataset which is a field i...
# flyte-github
c
#3071 Return StructuredDataset which is a field in a dataclass Pull request opened by arbaobao ## Tracking issue Related to #6117 ## Why are the changes needed? If we wrap the StructuredDataset in a dataclass, it will fail during the to_flyte_idl conversion. ## What changes were proposed in this pull request? Before returning
Literals
, we check the type of
python_val._literal_sd
. If it is a Python native
StructuredDataset
, we transform it into a
Literals.StructuredDataset
. ## How was this patch tested? As described in #6117, an error occurs when the
extract
task is executed.
Copy code
@dataclass
class Data:
    f: StructuredDataset


@task
def create_data() -> Data:
    return Data(f=StructuredDataset(dataframe=pd.DataFrame({"a": [5]})))


@task
def extract(d: Data) -> StructuredDataset:
    return d.f


@workflow
def example_wf() -> None:
    d = create_data()
    f = extract(d=d)
### Setup process ### Screenshots ## Check all the applicable boxes • I updated the documentation accordingly. • All new and existing tests passed. • All commits are signed-off. ### Summary by Bito This PR implements comprehensive improvements to Flytekit's core functionality, including StructuredDataset handling, caching system enhancements, and a new rate limiting system. The changes transition from in-memory DataFrame to file-based approach, integrate Kubernetes StatefulSet Data Service and Ray plugins, while improving dictionary and annotated type handling. Key improvements include enhanced error handling, better array node handling in remote execution, improved workflow execution tracking, and strengthened input validation across multiple components. Unit tests added: True Estimated effort to review (1-5, lower is better): 5 flyteorg/flytekit