如何在Foundry中保存历史数据集

huangapple go评论71阅读模式
英文:

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请求有一定的了解:

  1. 获取所需数据集的RID(示例在下面的截图中),以及与您想要的数据集版本对应的交易ID。
    [如何在Foundry中保存历史数据集

  2. 通过运行如下填充的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"}'

  3. 用适当的值替换YOUR_AUTH_TOKEN,STACK_URL,YOUR_DATASET_RID,NEW_BRANCH_NAMEYOUR_TRANSACTION_ID。可以按照这些说明生成短期身份验证令牌。

  4. 将分支保存到代码仓库中的新数据集中,指定输入为数据集的路径,以及第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:

  1. 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.
    [如何在Foundry中保存历史数据集

  2. 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"}'

  3. Replace YOUR_AUTH_TOKEN, STACK_URL, YOUR_DATASET_RID, NEW_BRANCH_NAME and YOUR_TRANSACTION_ID with appropriate values. Short lived authentication token can be generated following these instructions.

  4. 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.

huangapple
  • 本文由 发表于 2023年2月9日 00:44:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/75389006.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定