Repository navigation
Add dagster-pixeltable integration - #366
Open
pierrebrunelle wants to merge 1 commit into
Open
pierrebrunelle wants to merge 1 commit into
pierrebrunelle wants to merge 1 commit into
Conversation
PixeltableResource checks the Pixeltable home of the Dagster process against expected_home, initializes the SDK during resource setup, and opens existing local tables by full path. Assets write with the Pixeltable SDK. examples/basic upserts records by primary key into a table deployed with `pxt schema update`, reports table metadata, and checks computed values. examples/video appends a clip to a video table with a frame view. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary & Motivation
Adds
dagster-pixeltable, a resource for running Dagster jobs against existing Pixeltable tables. Dagster schedules runs, orders work across systems, and records run history. Pixeltable stores the data and maintains computed columns, views, and indexes.PixeltableResource(expected_home=...): Pixeltable keeps one instance per process, chosen byPIXELTABLE_HOME. Setup rejects a relative or~home, and a home that differs fromexpected_homeor from an earlier SDK initialization in the process. It then callspxt.init().get_table(path)opens an existing local table, view, or snapshot. It rejects hosted paths (pxt://...,https://pixeltable.com/t/...) and works only between setup and teardown. Assets write with the Pixeltable SDK; the resource adds no wrappers.examples/basic: a table declared as aTableModeland deployed withpxt schema update. The asset upserts records by primary key withbatch_update(..., if_not_exists="insert")and returns aMaterializeResultwith the table name, row count, column schema, table id, and version. An asset check verifies the computed columns.examples/video: apxt.Videotable with a frame view. The asset appends withinsert, becausebatch_updatecannot write media columns.Scope of 0.1.0: the in-process executor on one host. Both examples set
executor=in_process_executor. There is no IO manager, partition support, multiprocess support, or Component.Dependencies
requires-python = ">=3.11": Pixeltable requires 3.11.dagster>=1.9.4: Pixeltable requirespydantic>=2.11. Dagster 1.8.5 to 1.9.3 cap pydantic below 2.10, and 1.8.0 to 1.8.4 predate theTableMetadataSetfix that led to that cap.pixeltable>=0.7.15,pydantic>=2.11(direct, forPrivateAttr). No upper bounds and no extras, like the other libraries here.Notes for reviewers
pxtdaemon on a free port. Session teardown stops both. Docker and credentials are not needed. The suite takes about 35 s.examples/video/clip.mp4(9.9 KB) comes from Pixeltable's Apache-2.0 test data.ty check .exits 0 with 3unsupported-basewarnings in the exampleapp.pyfiles, which come from Pixeltable'sTableModelmetaclass.dagster_pixeltable-0.1.0. Publishing uses this repository's token, so we would like to agree on who cuts releases. We would also like to know whether a Pixeltable maintainer can be added on PyPI to ship fixes. Pixeltable-side maintainer: @pierrebrunelle.How I Tested These Changes
Base
b93b3eae05b747a57453241ef160dd01df389238, head7a2c51f2d9f819977b15f79246545f0965aeab29.--resolution lowest-direct)The Linux runs used the shared workflow's steps:
uv python install 3.12,uv sync --all-extras,ruff check,ruff format --check,ty check .,pytest.The tests cover:
~homes, including a cached relative home that would otherwise resolve to the expected one.pxt schema update, thendagster asset materializetwice, then a readback from a fresh process.batch_updaterejects media even for new rows.Also:
dagster_pixeltable/. Installed it into a fresh venv without extras. From a copy ofexamples/outside the checkout, ranpxt schema update, randagster asset materializetwice (3 rows, 0 computed errors), and ran the video example.dagster dev(withdagster-webserver1.13.26): materializedingest_documentsfrom the UI. The run succeeded, and the asset page showed row count 3 and the column schema.reportPrivateImportUsageerrors in the package, forpxt.home,pxt.init,pxt.get_table, andpxt.Table. Pixeltable builds__all__at runtime, so Pyright cannot see its exports. This is a Pixeltable typing issue, not specific to this package.Changelog
libraries/dagster-pixeltable/CHANGELOG.mdhas an[Unreleased]entry.