From 3869bbf4d186cde64d476e1253fcc488628e370b Mon Sep 17 00:00:00 2001 From: dat-a-man <98139823+dat-a-man@users.noreply.github.com> Date: Sat, 3 Aug 2024 05:12:50 +0000 Subject: [PATCH] Updated for the example --- docs/website/docs/general-usage/schema.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/website/docs/general-usage/schema.md b/docs/website/docs/general-usage/schema.md index 5b7bb7ec36..ee6cfa5310 100644 --- a/docs/website/docs/general-usage/schema.md +++ b/docs/website/docs/general-usage/schema.md @@ -364,9 +364,24 @@ We recommend to not create schemas explicitly. Instead, user should provide a fe settings and then let the table and column schemas to be generated from the resource hints and the data itself. -To view and print the default schema in a clear YAML format, use the following command: +To view and print the default schema in a clear YAML format use the command: ```py +pipeline.default_schema.to_pretty_yaml() +``` +This can be used in a pipeline as: + +```py +# Create a pipeline +pipeline = dlt.pipeline( + pipeline_name="chess_pipeline", + destination='duckdb', + dataset_name="games_data") + +# Run the pipeline +load_info = pipeline.run(source) + +# Print the default schema in a pretty YAML format print(pipeline.default_schema.to_pretty_yaml()) ``` This will display a structured YAML representation of your schema, showing details like tables, columns, data types, and metadata, including version, version_hash, and engine_version.