From fd6144082fcc3473136cd496349a8c62e19378fb Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Wed, 29 May 2024 11:18:04 -0700 Subject: [PATCH 1/2] Update flytefile.md Signed-off-by: Yee Hing Tong --- docs/user_guide/data_types_and_io/flytefile.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/user_guide/data_types_and_io/flytefile.md b/docs/user_guide/data_types_and_io/flytefile.md index 883b7c5e0c..8bc4471559 100644 --- a/docs/user_guide/data_types_and_io/flytefile.md +++ b/docs/user_guide/data_types_and_io/flytefile.md @@ -56,14 +56,14 @@ When this task finishes, the Flytekit engine returns the `FlyteFile` instance, u Lastly, define a workflow. The `normalize_csv_files` workflow has an `output_location` argument which is passed to the `location` input of the task. If it's not an empty string, the task attempts to upload its file to that location. -```{rli} https://raw.githubusercontent.com/flyteorg/flytesnacks/master/examples/data_types_and_io/data_types_and_io/file.py +```{rli} https://raw.githubusercontent.com/flyteorg/flytesnacks/0ec8388759d34566a0ffc0c3c2d7443fd4a3a46f/examples/data_types_and_io/data_types_and_io/file.py :caption: data_types_and_io/file.py :pyobject: normalize_csv_file ``` You can run the workflow locally as follows: -```{rli} https://raw.githubusercontent.com/flyteorg/flytesnacks/master/examples/data_types_and_io/data_types_and_io/file.py +```{rli} https://raw.githubusercontent.com/flyteorg/flytesnacks/0ec8388759d34566a0ffc0c3c2d7443fd4a3a46f/examples/data_types_and_io/data_types_and_io/file.py :caption: data_types_and_io/file.py :lines: 75-95 ``` From 668ef1de358ef4b6ee8f851261fe4981a5ea23cc Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Wed, 29 May 2024 15:49:48 -0700 Subject: [PATCH 2/2] use sha Signed-off-by: Yee Hing Tong --- docs/user_guide/extending/custom_types.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/user_guide/extending/custom_types.md b/docs/user_guide/extending/custom_types.md index d0c68b59e4..a9670e9e8f 100644 --- a/docs/user_guide/extending/custom_types.md +++ b/docs/user_guide/extending/custom_types.md @@ -27,7 +27,7 @@ To clone and run the example code on this page, see the [Flytesnacks repo][flyte First, we import the dependencies: -```{rli} https://raw.githubusercontent.com/flyteorg/flytesnacks/master/examples/extending/extending/custom_types.py +```{rli} https://raw.githubusercontent.com/flyteorg/flytesnacks/0ec8388759d34566a0ffc0c3c2d7443fd4a3a46f/examples/extending/extending/custom_types.py :caption: extending/custom_types.py :lines: 1-7 ``` @@ -38,7 +38,7 @@ First, we import the dependencies: Defined type here represents a list of files on the disk. We will refer to it as `MyDataset`. -```{rli} https://raw.githubusercontent.com/flyteorg/flytesnacks/master/examples/extending/extending/custom_types.py +```{rli} https://raw.githubusercontent.com/flyteorg/flytesnacks/0ec8388759d34566a0ffc0c3c2d7443fd4a3a46f/examples/extending/extending/custom_types.py :caption: extending/custom_types.py :pyobject: MyDataset ``` @@ -53,7 +53,7 @@ The `TypeTransformer` is a Generic abstract base class. The `Generic` type argum that we want to work with. In this case, it is the `MyDataset` object. ::: -```{rli} https://raw.githubusercontent.com/flyteorg/flytesnacks/master/examples/extending/extending/custom_types.py +```{rli} https://raw.githubusercontent.com/flyteorg/flytesnacks/0ec8388759d34566a0ffc0c3c2d7443fd4a3a46f/examples/extending/extending/custom_types.py :caption: extending/custom_types.py :pyobject: MyDatasetTransformer ``` @@ -61,23 +61,23 @@ that we want to work with. In this case, it is the `MyDataset` object. Before we can use MyDataset in our tasks, we need to let Flytekit know that `MyDataset` should be considered as a valid type. This is done using {py:class}`~flytekit:flytekit.extend.TypeEngine`'s `register` method. -```{rli} https://raw.githubusercontent.com/flyteorg/flytesnacks/master/examples/extending/extending/custom_types.py +```{rli} https://raw.githubusercontent.com/flyteorg/flytesnacks/0ec8388759d34566a0ffc0c3c2d7443fd4a3a46f/examples/extending/extending/custom_types.py :caption: extending/custom_types.py :lines: 87 ``` The new type should be ready to use! Let us write an example generator and consumer for this new datatype. -```{rli} https://raw.githubusercontent.com/flyteorg/flytesnacks/master/examples/extending/extending/custom_types.py +```{rli} https://raw.githubusercontent.com/flyteorg/flytesnacks/0ec8388759d34566a0ffc0c3c2d7443fd4a3a46f/examples/extending/extending/custom_types.py :caption: extending/custom_types.py :lines: 91-114 ``` This workflow can be executed and tested locally. Flytekit will exercise the entire path even if you run it locally. -```{rli} https://raw.githubusercontent.com/flyteorg/flytesnacks/master/examples/extending/extending/custom_types.py +```{rli} https://raw.githubusercontent.com/flyteorg/flytesnacks/0ec8388759d34566a0ffc0c3c2d7443fd4a3a46f/examples/extending/extending/custom_types.py :caption: extending/custom_types.py :lines: 119-120 ``` -[flytesnacks]: https://github.com/flyteorg/flytesnacks/tree/master/examples/extending/ +[flytesnacks]: https://github.com/flyteorg/flytesnacks/tree/0ec8388759d34566a0ffc0c3c2d7443fd4a3a46f/examples/extending/