Asset Loading
load_rocky_assets() calls rocky discover and returns a list of Dagster AssetSpec objects, one for each enabled table across all sources. This gives you automatic asset discovery without manually defining each table.
How it works
Section titled “How it works”load_rocky_assets()invokesrocky.discover()under the hood.- Each enabled table across all sources becomes one
AssetSpec. - Asset keys, groups, tags, and metadata are derived from the source and table information.
Default mappings
Section titled “Default mappings”Asset key
Section titled “Asset key”The default asset key is constructed from the source type, component values, and table name:
[source_type, *component_values, table_name]For example, a table orders from a Fivetran source with components tenant=acme, regions=us_west, connector=shopify produces:
["fivetran", "acme", "us_west", "shopify", "orders"]The default group name is the first component value. For the example above, the group would be "acme".
rocky/source_type— the source type (e.g.,"fivetran")rocky/<component_name>— one tag per string component (e.g.,rocky/tenant: "acme")
Metadata
Section titled “Metadata”source_id— the source identifiersource_type— the source typelast_sync_at— timestamp of the last syncrow_count— number of rows in the table
Example
Section titled “Example”from dagster_rocky import RockyResource, load_rocky_assetsimport dagster as dg
rocky = RockyResource(config_path="rocky.toml")assets = load_rocky_assets(rocky)
defs = dg.Definitions( assets=assets, resources={"rocky": rocky},)Custom translation
Section titled “Custom translation”To customize how sources and tables map to Dagster concepts, pass a custom translator. See Translator for details.
assets = load_rocky_assets(rocky, translator=MyTranslator())