Repository navigation
dagster-teradata: add I/O manager with pandas, polars and PySpark type handlers - #7
Merged
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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
Adds a Dagster I/O manager for Teradata to
dagster-teradata, with type handlers for pandas, polars and PySpark DataFrames. An asset that returns a DataFrame is stored as a Teradata table and loaded back for downstream assets, with no hand-written SQL orCREATE TABLE.Only
libraries/dagster-teradatais changed (plus one CI line, see below).What's new
I/O manager core (
io_manager.py)TeradataIOManager,TeradataDbIOManager,TeradataDbClientandbuild_teradata_io_manager, built on Dagster'sDbIOManager.Type handlers
TeradataPandasIOManager/TeradataPandasTypeHandlerpandasTeradataPolarsIOManager/TeradataPolarsTypeHandlerpolarsTeradataPySparkIOManager/TeradataPySparkTypeHandlerpyspark_catalog.py(DBC catalog reflection, character-type parsing, drift check) and_type_handler_base.py.dagster_teradata, so importing the package does not require pandas, polars or pyspark. A missing or too-old dependency gives an actionable error.column_typeslets callers override the Teradata type per column.Safety checks before any destructive step. The previous slice is deleted before the write is committed, so the handlers validate first:
NOT NULL,PRIMARY KEY, ...) are rejected;Packaging and docs
pandas,polars,pyspark;requires-pythonis now>=3.10;pandasadded to dev deps;uv.lockregenerated.README.mdupdated, new user guidedocs/io-manager.md, a runnableexamples/kitchen_sink/project, andPLANS.md(design and decision log).CI
quality-check-dagster-teradata.yml: the type-check step ranuv run pyright, which isn't a dependency. It now runsuv run ty check ., matching the Makefile.Tests
dagster_teradata_tests/functional/(not run in CI; they need a database): 16/16 passed, including the PySpark JDBC path.test_tpt_utilspermission tests fail on Windows only, regardless of this change.Notes for reviewers
TeradataResource, BTEQ and TPT code are untouched.column_typesoverrides.