From a7027630a3c2fe660ed875fc428f2f6784591ce9 Mon Sep 17 00:00:00 2001 From: JieguangZhou Date: Tue, 7 Jan 2025 10:46:29 +0800 Subject: [PATCH] Fix the error when using batch apply with dataset. --- CHANGELOG.md | 3 ++- superduper/backends/base/queue.py | 2 +- superduper/backends/local/queue.py | 2 +- superduper/rest/base.py | 1 + superduper/rest/build.py | 10 +++++++--- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22b7fbcc0..4ac68177d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Changed defaults / behaviours -- Deprecate vanilla `DataType` +- Deprecate vanilla `DataType` - Remove `_Encodable` from project - Connect to Snowflake using the incluster oauth token - Add postprocess in apibase model. @@ -53,6 +53,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix the bug in the update mechanism that fails when the parent references an existing child. - Fix minor bug in openai plugin init method - Fix the frontend rendering issue related to choices when it is set to /describe_tables. +- Fix the error when using batch apply with dataset. ## [0.4.0](https://github.com/superduper-io/superduper/compare/0.4.0...0.3.0]) (2024-Nov-02) diff --git a/superduper/backends/base/queue.py b/superduper/backends/base/queue.py index 295589aad..bce62e2a9 100644 --- a/superduper/backends/base/queue.py +++ b/superduper/backends/base/queue.py @@ -210,7 +210,7 @@ def _consume_event_type(event_type, ids, table, db: 'Datalayer'): db.cluster.compute.release_futures(context) -table_type_ids = {'table', 'schema', 'data', 'datatype'} +table_type_ids = {'table', 'schema', 'data', 'datatype', 'dataset'} def consume_events(events, table: str, db=None): diff --git a/superduper/backends/local/queue.py b/superduper/backends/local/queue.py index 72c6c8648..8bb76137c 100644 --- a/superduper/backends/local/queue.py +++ b/superduper/backends/local/queue.py @@ -7,7 +7,7 @@ BaseQueuePublisher, consume_events, ) -from superduper.base.event import Create, Event +from superduper.base.event import Event from superduper.components.cdc import CDC if t.TYPE_CHECKING: diff --git a/superduper/rest/base.py b/superduper/rest/base.py index 106fa6dde..c171bd9bc 100644 --- a/superduper/rest/base.py +++ b/superduper/rest/base.py @@ -206,6 +206,7 @@ def _add_templates(self, db): if os.path.exists(t): from superduper import Template + t = Template.read(t) else: t = templates.get(t) diff --git a/superduper/rest/build.py b/superduper/rest/build.py index 77ca0de7c..834a7b8a2 100644 --- a/superduper/rest/build.py +++ b/superduper/rest/build.py @@ -8,8 +8,6 @@ import zipfile from contextlib import contextmanager -from superduper.base.leaf import import_item -from superduper.components.application import Application from superduper.misc.importing import import_object try: @@ -262,7 +260,13 @@ def db_show( initialized = [(r['type_id'], r['identifier']) for r in out] for pending_app in PENDING_COMPONENTS: if pending_app not in initialized: - out.append({'type_id': pending_app[0], 'identifier': pending_app[1], 'status': 'pending'}) + out.append( + { + 'type_id': pending_app[0], + 'identifier': pending_app[1], + 'status': 'pending', + } + ) return out @app.add('/db/remove', method='post')