This release is a pre-release and may not be stable for production use.
SegmentStream pipeline SDK
segmentstream-pipeline is the small runtime contract between a workspace's
Dagster definitions and the warehouse provisioned by SegmentStream. Dagster
continues to own assets and jobs, while Ibis continues to own relational
expressions. This package supplies lazy runtime configuration and durable
warehouse I/O.
The initial connector supports BigQuery, automatic dataset creation, full-table
replacement for unpartitioned assets, and native daily DATE partitioning. It
reads the following non-secret configuration when a pipeline first accesses the
warehouse:
SEGMENTSTREAM_WAREHOUSE_ENGINESEGMENTSTREAM_WAREHOUSE_CATALOGSEGMENTSTREAM_WAREHOUSE_DEFAULT_NAMESPACESEGMENTSTREAM_WAREHOUSE_LOCATION(optional)
Configuration and authentication are deliberately lazy. Importing and
validating definitions.py during a deployment build does not connect to a
warehouse. In Cloud Run, the BigQuery connector uses the attached workload
identity through Application Default Credentials.
import ibis
import ibis.expr.types as ir
import segmentstream.dagster as dg
from segmentstream import WAREHOUSE_IO_MANAGER_KEY, warehouse_resources
BRONZE_ORDERS = dg.AssetKey(["bronze", "orders"])
SILVER_ORDERS = dg.AssetKey(["silver", "orders"])
@dg.asset(
key=BRONZE_ORDERS,
io_manager_key=WAREHOUSE_IO_MANAGER_KEY,
kinds={"ibis"},
)
def orders() -> ir.Table:
return ibis.memtable(
[{"order_id": "o-1", "amount": 100.0}],
schema={"order_id": "string", "amount": "float64"},
)
@dg.asset(
key=SILVER_ORDERS,
ins={"orders": dg.AssetIn(key=BRONZE_ORDERS)},
io_manager_key=WAREHOUSE_IO_MANAGER_KEY,
kinds={"ibis"},
)
def normalized_orders(orders: ir.Table) -> ir.Table:
return orders.filter(orders.amount > 0)
defs = dg.Definitions(
assets=[orders, normalized_orders],
resources=warehouse_resources(),
)
Daily assets use Dagster's native daily partitions and declare the physical
BigQuery DATE column through SegmentStream metadata:
from datetime import date
import ibis
import ibis.expr.types as ir
import segmentstream.dagster as dg
from segmentstream import (
WAREHOUSE_IO_MANAGER_KEY,
warehouse_asset_metadata,
)
daily = dg.DailyPartitionsDefinition(start_date="2026-01-01")
@dg.asset(
key=["silver", "daily_orders"],
partitions_def=daily,
backfill_policy=dg.BackfillPolicy.multi_run(max_partitions_per_run=10),
metadata=warehouse_asset_metadata(partition_by_date="event_date"),
io_manager_key=WAREHOUSE_IO_MANAGER_KEY,
)
def daily_orders(context: dg.AssetExecutionContext) -> ir.Table:
partition_dates = [date.fromisoformat(key) for key in context.partition_keys]
return ibis.memtable(
[{"event_date": value, "order_count": 0} for value in partition_dates],
schema={"event_date": "date", "order_count": "int64"},
)
SegmentStream accepts only unpartitioned assets and default-midnight
DailyPartitionsDefinition assets with YYYY-MM-DD keys. Deployment inspection
rejects other partition definitions and daily assets without physical partition
metadata. The IO manager maps Dagster's partition time window to a half-open
warehouse date range, filters upstream Ibis relations to that range, creates the
table with native daily partitioning on first materialization, and atomically
replaces only those dates on subsequent materializations.
Asset keys map to relations using a small convention:
["orders"]uses the configured default namespace.["bronze", "orders"]uses the explicitbronzedataset.- Other key shapes are rejected.
The workspace project is always supplied by SegmentStream and cannot be
overridden by an asset. Before writing an asset, the IO manager creates its
validated dataset with CREATE SCHEMA IF NOT EXISTS in the configured location.
This lets pipeline authors organize one workspace project into datasets such as
bronze, silver, and gold without provisioning them separately.
For local package development, install this project in editable mode rather than adding a relative path dependency to a deployable pipeline.
Workspace pipelines declare only the SegmentStream SDK. It installs the pinned Dagster and Ibis versions that belong to that SDK release:
[project]
dependencies = [
"segmentstream-pipeline[bigquery]==0.1.0a5",
]
Pipeline definitions import segmentstream.dagster as their curated Dagster
namespace. Its objects are direct re-exports from Dagster, not wrappers. APIs
outside that namespace are not part of the SegmentStream Cloud compatibility
contract even if they remain importable from the underlying dependency.
The same installed package contains SegmentStream's private Cloud Run runtime:
the deployment inspector, persistent Dagster instance setup, and ephemeral
backfill coordinator. Workspace code does not call these modules directly.
Keeping them in this distribution ensures that the SDK, Dagster, and
dagster-postgres versions always move together; the backend only builds and
launches the installed runtime.
Releases
Releases use the version declared in pyproject.toml and are published from the
pipeline-sdk-v<version> Git tag by the protected pipeline-sdk-release.yml
workflow. The workflow builds the wheel and source distribution in a job without
publishing credentials, then uses PyPI Trusted Publishing from the pypi GitHub
environment. No long-lived PyPI token is stored in GitHub.
PyPI releases are immutable. Increment the package version before creating a new release tag; do not reuse a version that has already been uploaded.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file segmentstream_pipeline-0.1.0a5.tar.gz.
File metadata
- Download URL: segmentstream_pipeline-0.1.0a5.tar.gz
- Upload date:
- Size: 92.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1744f5989091a44b749dd5da7cd1e2957ad9d3eeed710ee30a8a5ecb4492c617
|
|
| MD5 |
c5a82ebf811a5686c9cf958997cded8e
|
|
| BLAKE2b-256 |
286f6e6cdd5a563e723cc0e11e144650ea785d5ea1d8a092ab0d2c4b822504fc
|
Provenance
The following attestation bundles were made for segmentstream_pipeline-0.1.0a5.tar.gz:
Publisher:
pipeline-sdk-release.yml on segmentstream/segmentstream
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
segmentstream_pipeline-0.1.0a5.tar.gz -
Subject digest:
1744f5989091a44b749dd5da7cd1e2957ad9d3eeed710ee30a8a5ecb4492c617 - Sigstore transparency entry: 2636205786
- Sigstore integration time:
-
Permalink:
segmentstream/segmentstream@70f8bc256a32b9f99e0b31109d64f3ae9e55e743 -
Branch / Tag:
refs/tags/pipeline-sdk-v0.1.0a5 - Owner: https://github.com/segmentstream
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pipeline-sdk-release.yml@70f8bc256a32b9f99e0b31109d64f3ae9e55e743 -
Trigger Event:
push
-
Statement type:
File details
Details for the file segmentstream_pipeline-0.1.0a5-py3-none-any.whl.
File metadata
- Download URL: segmentstream_pipeline-0.1.0a5-py3-none-any.whl
- Upload date:
- Size: 25.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8efe5f53e1054d3aac54d82243cc2abd40c113d888e7cc2d52b25d8f1b973b1
|
|
| MD5 |
008080e92bf9e7343f658f38c02e0b21
|
|
| BLAKE2b-256 |
63493df21a8ac31f73c086e1dd7cff5453f7abfe2300038e1e2f3ab5490f7a43
|
Provenance
The following attestation bundles were made for segmentstream_pipeline-0.1.0a5-py3-none-any.whl:
Publisher:
pipeline-sdk-release.yml on segmentstream/segmentstream
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
segmentstream_pipeline-0.1.0a5-py3-none-any.whl -
Subject digest:
a8efe5f53e1054d3aac54d82243cc2abd40c113d888e7cc2d52b25d8f1b973b1 - Sigstore transparency entry: 2636205816
- Sigstore integration time:
-
Permalink:
segmentstream/segmentstream@70f8bc256a32b9f99e0b31109d64f3ae9e55e743 -
Branch / Tag:
refs/tags/pipeline-sdk-v0.1.0a5 - Owner: https://github.com/segmentstream
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pipeline-sdk-release.yml@70f8bc256a32b9f99e0b31109d64f3ae9e55e743 -
Trigger Event:
push
-
Statement type: