英文:
How do I save a historical (past) dataset in Foundry
问题
我想保存一个名为(order_clean)的数据集版本。但不是当前版本。我想保存的版本来自过去。我了解这是一个历史交易,仍然在我保留政策窗口内。我应该如何做到这一点?
英文:
I want to save a version of my dataset called (order_clean). But not the current version. The version I want to save is from the past. I understand this is a historical transaction that still exists within my retention policy window. How would I be able to do this?
答案1
得分: 2
这可以通过API调用和命中特定的端点来完成。
此答案假定您对授权令牌和curl请求有一定的了解:
-
获取所需数据集的RID(示例在下面的截图中),以及与您想要的数据集版本对应的交易ID。
[ -
通过运行如下填充的curl请求,在您的特定数据集中创建一个新分支:
curl -X POST -H "Content-type: application/json" -H "Authorization: Bearer YOUR_AUTH_TOKEN" "STACK_URL/foundry-catalog/api/catalog/datasets/YOUR_DATASET_RID/branchesUnrestricted2/NEW_BRANCH_NAME" -d '{"parentRef": "YOUR_TRANSACTION_ID", "parentBranchId": "master"}'
-
用适当的值替换
YOUR_AUTH_TOKEN,STACK_URL,YOUR_DATASET_RID,NEW_BRANCH_NAME
和YOUR_TRANSACTION_ID
。可以按照这些说明生成短期身份验证令牌。 -
将分支保存到代码仓库中的新数据集中,指定输入为数据集的路径,以及第2步中的新分支名称。
英文:
This can be done via an API call and hitting a specific endpoint.
This answer assumes a working knowledge around authorization tokens and curl requests:
-
Obtain the desired dataset’s RID (Example in screenshot below), as well as the transaction ID of the transaction corresponding to the version of the dataset you want.
[ -
Create a new branch in your specific dataset by running a curl request populated as follows:
curl -X POST -H "Content-type: application/json" -H "Authorization: Bearer YOUR_AUTH_TOKEN" "STACK_URL/foundry-catalog/api/catalog/datasets/YOUR_DATASET_RID/branchesUnrestricted2/NEW_BRANCH_NAME" -d '{"parentRef": "YOUR_TRANSACTION_ID", "parentBranchId": "master"}'
-
Replace
YOUR_AUTH_TOKEN, STACK_URL, YOUR_DATASET_RID, NEW_BRANCH_NAME
andYOUR_TRANSACTION_ID
with appropriate values. Short lived authentication token can be generated following these instructions. -
Save the branch into a new dataset with a transform in a Code Repo, specifying the Input with the path to the dataset as well as the new branch’s name from #2.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论