Skip to content

Commit

Permalink
Updated for the example
Browse files Browse the repository at this point in the history
  • Loading branch information
dat-a-man committed Aug 3, 2024
1 parent 53ebc76 commit 3869bbf
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion docs/website/docs/general-usage/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 3869bbf

Please sign in to comment.