I have two datasets in foundry : df1 & df2, df1 has data with a schema.
the df2 is the empty dataframe with no schema applied.
Using data proxy i was able to extract the schema from df1
{
"foundrySchema": {
"fieldSchemaList": [
{...
}
],
"primaryKey": null,
"dataFrameReaderClass": "n/a",
"customMetadata": {}
},
"rows": []
}
how can i apply this schema to the empty dataframe df2 via a rest call ?
The below foundry example shows how to commit an empty transaction, this example does not show how to apply the schema
curl -X POST \
-H "Authorization: Bearer ${TOKEN}" \
-H "Content-Type: application/json" \
-d '{}' \
"${CATALOG_URL}/api/catalog/datasets/${DATASET_RID}/transactions/${TRANSACTION_RID}/commit"
Here is a Python function to upload a schema for a dataset with a committed transaction: