diff --git a/superduperdb/components/component.py b/superduperdb/components/component.py index 395f46c45..facf21f4f 100644 --- a/superduperdb/components/component.py +++ b/superduperdb/components/component.py @@ -116,7 +116,7 @@ class Component(Leaf): set_post_init: t.ClassVar[t.Sequence] = ('version',) changed: t.ClassVar[set] = set([]) plugins: t.Optional[t.List["Plugin"]] = None - + upstream: t.Optional[t.List["Component"]] = None artifacts: dc.InitVar[t.Optional[t.Dict]] = None @property diff --git a/superduperdb/components/dataset.py b/superduperdb/components/dataset.py index 57398d22b..7ad147630 100644 --- a/superduperdb/components/dataset.py +++ b/superduperdb/components/dataset.py @@ -94,3 +94,13 @@ def __str__(self): return f'Dataset(identifier={self.identifier}, select={self.select})' __repr__ = __str__ + + +class DataInit(Component): + data: t.List[t.Dict] + table: str + + def post_create(self, db: Datalayer) -> None: + super().post_create(db) + self.init() + db[self.table].insert(self.data).execute()