-
Notifications
You must be signed in to change notification settings - Fork 4
generate_from_schema Examples
Ravi Kiran Pagidi edited this page Jun 28, 2026
·
1 revision
df = generate_from_schema(
{"customer_id": "string", "customer_name": "string", "age": "int"},
rows=1000,
)df = generate_from_schema(
"customer_id string, customer_name string, age int, created_at timestamp",
rows=1000,
)import pandas as pd
empty = pd.DataFrame(
{
"customer_id": pd.Series(dtype="string"),
"age": pd.Series(dtype="int64"),
}
)
df = generate_from_schema(empty, rows=1000)df, report = generate_from_schema(
schema,
rows=1000,
custom_rules={
"customer_id": {"prefix": "CUST"},
"age": {"min": 18, "max": 85},
},
validate=True,
return_report=True,
)spark_df = generate_from_schema(spark_struct_type, rows=1000, engine="spark")
spark_df.write.mode("overwrite").parquet("synthetic/customers")See Supported Schema Input Types before adapting an example to JSON Schema, YAML, full SQL DDL, ORM, Pydantic, or dataclass inputs.