From 3b7949a02068a5f20840ff8bdb01c3226fb6c273 Mon Sep 17 00:00:00 2001 From: JieguangZhou Date: Wed, 21 Aug 2024 22:16:17 +0800 Subject: [PATCH] Fix form_template --- CHANGELOG.md | 1 + superduper/components/component.py | 2 ++ superduper/components/template.py | 1 + 3 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd33c2770..3d4e3acec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,6 +58,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix a minor bug in schedule_jobs - Fix vector index cleanup - Fix the condition of the CDC job. +- Fix form_template ## [0.3.0](https://github.com/superduper-io/superduper/compare/0.3.0...0.2.0]) (2024-Jun-21) diff --git a/superduper/components/component.py b/superduper/components/component.py index 8e49aae7e..f4e730574 100644 --- a/superduper/components/component.py +++ b/superduper/components/component.py @@ -128,6 +128,8 @@ def from_template( from superduper import Template if template_name: + from superduper.base.datalayer import Datalayer + assert isinstance(db, Datalayer) template: Template = db.load('template', template_name) else: diff --git a/superduper/components/template.py b/superduper/components/template.py index d7818eb30..129fd0e46 100644 --- a/superduper/components/template.py +++ b/superduper/components/template.py @@ -62,6 +62,7 @@ def form_template(self): k: f'' for i, k in enumerate(self.template_variables) }, **{k: v for k, v in self.template.items() if k != 'identifier'}, + '_template_name': self.identifier, }