Skip to content

Commit

Permalink
apply changes from flytesnacks user guide - see flyteorg/flytesnacks#…
Browse files Browse the repository at this point in the history
…1516 (#4933)

Signed-off-by: nikki everett <[email protected]>
  • Loading branch information
neverett authored Feb 22, 2024
1 parent e4d1926 commit fdaa021
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions docs/user_guide/data_types_and_io/structureddataset.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,22 @@ It offers the following benefits:
(not only at compile time, but also runtime since type information is carried along in the literal),
store third-party schema definitions, and potentially in the future, render sample data, provide summary statistics, etc.

## Usage

To use the `StructuredDataset` type, import `pandas` and define a task that returns a Pandas Dataframe.
Flytekit will detect the Pandas DataFrame return signature and convert the interface for the task to
the {py:class}`StructuredDataset` type.

## Example

This example demonstrates how to work with a structured dataset using Flyte entities.

To begin, import the necessary dependencies.
```{note}
To use the `StructuredDataset` type, you only need to import `pandas`.
The other imports specified below are only necessary for this specific example.
```

To begin, import the dependencies for the example:

```{code-cell}
import os
Expand All @@ -67,8 +80,6 @@ from typing_extensions import Annotated
+++ {"lines_to_next_cell": 0}

Define a task that returns a Pandas DataFrame.
Flytekit will detect the Pandas dataframe return signature and
convert the interface for the task to the new {py:class}`StructuredDataset` type.

```{code-cell}
@task
Expand Down

0 comments on commit fdaa021

Please sign in to comment.