Skip to content

Type Reference

All data returned by RockyResource methods is parsed into Pydantic v2 models. These models provide type safety, validation, and IDE autocompletion.

Top-level result from rocky discover.

FieldTypeDescription
versionstrOutput schema version
commandstrCommand that produced this output
sourceslist[SourceInfo]Discovered sources

A discovered source (e.g., a Fivetran connector).

FieldTypeDescription
idstrSource identifier
componentsdict[str, str | list[str]]Parsed schema components (tenant, regions, connector, etc.)
source_typestrSource type (e.g., "fivetran")
last_sync_atstrTimestamp of last sync
tableslist[TableInfo]Tables in this source

A single table within a source.

FieldTypeDescription
namestrTable name
row_countint | NoneRow count, if available

Alias for SourceInfo. Provided for backward compatibility.


Top-level result from rocky run.

FieldTypeDescription
versionstrOutput schema version
commandstrCommand that produced this output
filterstrFilter that was applied
duration_msintTotal execution time in milliseconds
tables_copiedintNumber of tables copied
materializationslist[MaterializationInfo]Materialization details per table
check_resultslist[TableCheckResult]Check results per table
permissionsPermissionInfoPermission reconciliation summary
driftDriftInfoSchema drift detection summary
contractsContractResultContract validation results
anomalieslist[AnomalyResult]Anomaly detection results

Details about a single table materialization.

FieldTypeDescription
asset_keylist[str]Asset key path
rows_copiedintNumber of rows copied
duration_msintTime taken in milliseconds
metadataMaterializationMetadataAdditional metadata

Metadata attached to a materialization.

FieldTypeDescription
strategystrMaterialization strategy (e.g., "incremental", "full_refresh")
watermarkstrNew high watermark value

A single check result.

FieldTypeDescription
namestrCheck name (e.g., "row_count", "freshness")
passedboolWhether the check passed
source_countint | NoneSource row count (for row_count checks)
target_countint | NoneTarget row count (for row_count checks)
missinglist[str] | NoneMissing columns (for column_match checks)
extralist[str] | NoneExtra columns (for column_match checks)
lag_secondsint | NoneData lag in seconds (for freshness checks)
threshold_secondsint | NoneFreshness threshold (for freshness checks)
columnstr | NoneColumn name (for null_rate checks)
null_ratefloat | NoneObserved null rate (for null_rate checks)
thresholdfloat | NoneNull rate threshold (for null_rate checks)
querystr | NoneSQL query (for custom checks)
result_valuestr | NoneQuery result (for custom checks)

Check results grouped by table.

FieldTypeDescription
asset_keylist[str]Asset key path
checkslist[CheckResult]Check results for this table

Summary of permission reconciliation.

FieldTypeDescription
grants_addedintNumber of grants added
grants_revokedintNumber of grants revoked
catalogs_createdintNumber of catalogs created
schemas_createdintNumber of schemas created

Summary of schema drift detection.

FieldTypeDescription
tables_checkedintNumber of tables checked
tables_driftedintNumber of tables with drift
actions_takenlist[DriftAction]Actions taken to resolve drift

An action taken in response to schema drift.

FieldTypeDescription
tablestrFully qualified table name
actionstrAction taken (e.g., "drop_and_refresh")
reasonstrWhy the action was taken

Result of anomaly detection for a table.

FieldTypeDescription
tablestrFully qualified table name
current_countintCurrent row count
baseline_avgfloatBaseline average row count
deviation_pctfloatPercentage deviation from baseline
is_anomalyboolWhether this is considered an anomaly
reasonstrExplanation of the anomaly determination

Result of contract validation.

FieldTypeDescription
passedboolWhether all contracts passed
violationslist[ContractViolation]List of contract violations

A single contract violation.

FieldTypeDescription
rulestrContract rule that was violated
columnstrColumn involved in the violation
messagestrHuman-readable violation message

Top-level result from rocky plan.

FieldTypeDescription
versionstrOutput schema version
commandstrCommand that produced this output
filterstrFilter that was applied
statementslist[PlannedStatement]SQL statements that would be executed

A single planned SQL statement.

FieldTypeDescription
purposestrWhat this statement does (e.g., "create_catalog", "incremental_copy")
targetstrTarget object (e.g., "acme_warehouse.staging__us_west__shopify.orders")
sqlstrThe SQL statement

Top-level result from rocky state.

FieldTypeDescription
versionstrOutput schema version
commandstrCommand that produced this output
watermarkslist[WatermarkEntry]Current watermark entries

A watermark entry for a tracked table.

FieldTypeDescription
tablestrFully qualified table name
last_valuedatetimeLast watermark value
updated_atdatetimeWhen the watermark was last updated

Top-level result from rocky compile.

FieldTypeDescription
versionstrOutput schema version
commandstrCommand that produced this output
modelsintNumber of models compiled
execution_layersintNumber of execution layers in the DAG
diagnosticslist[Diagnostic]Compiler diagnostics (errors, warnings, info)
has_errorsboolWhether any diagnostics are errors
models_detaillist[ModelDetail]Per-model detail (strategy, target, freshness)

A compiler diagnostic (error, warning, or info).

FieldTypeDescription
severitySeverityOne of "Error", "Warning", "Info"
codestrDiagnostic code
messagestrHuman-readable message
modelstrModel name
spanSourceSpan | NoneLocation in source file
suggestionstr | NoneSuggested fix

Per-model summary from compilation.

FieldTypeDescription
namestrModel name
strategydictStrategy configuration (tagged union)
targetdict[str, str]Target catalog/schema/table
freshnessModelFreshnessConfig | NonePer-model freshness config

Full model lineage from rocky lineage <model>.

FieldTypeDescription
versionstrOutput schema version
commandstrCommand that produced this output
modelstrModel name
columnslist[ColumnDef]Output columns
upstreamlist[str]Upstream model names
downstreamlist[str]Downstream model names
edgeslist[LineageEdge]Column-level lineage edges

Single column trace from rocky lineage <model> --column <col>.

FieldTypeDescription
versionstrOutput schema version
commandstrCommand that produced this output
modelstrModel name
columnstrColumn name
tracelist[LineageEdge]Lineage trace edges

An edge in the column-level lineage graph.

FieldTypeDescription
sourceQualifiedColumnSource model and column
targetQualifiedColumnTarget model and column
transformstrTransform type (e.g. "direct", "cast", "expression", "aggregation(\"sum\")")

Top-level result from rocky test.

FieldTypeDescription
versionstrOutput schema version
commandstrCommand that produced this output
totalintTotal tests run
passedintTests passed
failedintTests failed
failureslist[list[str]]Failure details (model + message pairs)

Combined compile + test result from rocky ci.

FieldTypeDescription
versionstrOutput schema version
commandstrCommand that produced this output
compile_okboolWhether compilation succeeded
tests_okboolWhether all tests passed
models_compiledintNumber of models compiled
tests_passedintTests passed
tests_failedintTests failed
exit_codeintProcess exit code
diagnosticslist[Diagnostic]Compiler diagnostics
failureslist[list[str]]Test failure details

Pipeline run history from rocky history.

FieldTypeDescription
versionstrOutput schema version
commandstrCommand that produced this output
runslist[RunRecord]Run records
countintTotal run count

Single-model execution history from rocky history --model <name>.

FieldTypeDescription
versionstrOutput schema version
commandstrCommand that produced this output
modelstrModel name
executionslist[ModelExecution]Execution records
countintTotal execution count

A complete pipeline run record.

FieldTypeDescription
run_idstrUnique run identifier
started_atdatetimeRun start time
finished_atdatetimeRun end time
statusstrRun status
models_executedlist[ModelExecution]Models executed in this run
triggerstrWhat triggered the run
config_hashstrHash of the config used

A single model execution within a run.

FieldTypeDescription
model_namestrModel name
started_atdatetimeExecution start time
finished_atdatetimeExecution end time
duration_msintDuration in milliseconds
rows_affectedint | NoneRows affected
statusstrExecution status
sql_hashstrHash of the executed SQL
bytes_scannedint | NoneBytes scanned
bytes_writtenint | NoneBytes written

Quality metrics from rocky metrics <model>.

FieldTypeDescription
versionstrOutput schema version
commandstrCommand that produced this output
modelstrModel name
snapshotslist[QualitySnapshot]Point-in-time quality snapshots
countintNumber of snapshots
alertslist[dict] | NoneQuality alerts (when --alerts is set)
columnstr | NoneColumn filter (when --column is set)
column_trendlist[dict] | NoneColumn-level trend data

A point-in-time quality snapshot.

FieldTypeDescription
timestampdatetimeSnapshot time
run_idstrAssociated run ID
model_namestrModel name
metricsQualityMetricsQuality metrics

Quality metrics for a single snapshot.

FieldTypeDescription
row_countintRow count
null_ratesdict[str, float]Per-column null rates
freshness_lag_secondsint | NoneData freshness lag

Cost optimization recommendations from rocky optimize.

FieldTypeDescription
versionstrOutput schema version
commandstrCommand that produced this output
recommendationslist[MaterializationCost]Per-model recommendations
total_models_analyzedintTotal models analyzed

Cost estimate and strategy recommendation for a model.

FieldTypeDescription
model_namestrModel name
current_strategystrCurrent materialization strategy
compute_cost_per_runfloatCompute cost per run
storage_cost_per_monthfloatStorage cost per month
downstream_referencesintNumber of downstream references
recommended_strategystrRecommended strategy
estimated_monthly_savingsfloatEstimated monthly savings
reasoningstrExplanation of the recommendation

Result from rocky ai "<intent>".

FieldTypeDescription
versionstrOutput schema version
commandstrCommand that produced this output
intentstrOriginal intent description
formatstrOutput format
namestrGenerated model name
sourcestrGenerated model source code
attemptsintNumber of generation attempts

Result from rocky ai-sync.

FieldTypeDescription
versionstrOutput schema version
commandstrCommand that produced this output
proposalslist[AiSyncProposal]Proposed model updates

A proposed model update.

FieldTypeDescription
modelstrModel name
intentstrIntent description
current_sourcestrCurrent model source
proposed_sourcestrProposed updated source
diffstrDiff between current and proposed
upstream_changeslist[dict]Upstream schema changes that triggered the proposal

Result from rocky ai-explain.

FieldTypeDescription
versionstrOutput schema version
commandstrCommand that produced this output
explanationslist[AiExplanation]Per-model explanations

A single model explanation.

FieldTypeDescription
modelstrModel name
intentstrGenerated intent description
savedboolWhether the intent was saved to the model file

Result from rocky ai-test.

FieldTypeDescription
versionstrOutput schema version
commandstrCommand that produced this output
resultslist[AiTestModelResult]Per-model test results

Generated tests for a single model.

FieldTypeDescription
modelstrModel name
testslist[AiTestAssertion]Generated test assertions
savedboolWhether tests were saved to the model file

A single generated test assertion.

FieldTypeDescription
namestrTest name
sqlstrTest SQL
descriptionstrHuman-readable description

Result from rocky validate-migration.

FieldTypeDescription
versionstrOutput schema version
commandstrCommand that produced this output
validationslist[ModelValidation]Per-model validation results

Validation result for a single model.

FieldTypeDescription
modelstrModel name
present_in_dbtboolFound in dbt project
present_in_rockyboolFound in Rocky project
compile_okboolCompiles successfully
test_countintNumber of tests
contracts_generatedintNumber of contracts generated
warningslist[str]Validation warnings

Result from rocky test-adapter.

FieldTypeDescription
versionstrOutput schema version
commandstrCommand that produced this output
adapterstrAdapter name
sdk_versionstrAdapter SDK version
tests_runintTotal tests run
tests_passedintTests passed
tests_failedintTests failed
tests_skippedintTests skipped
resultslist[AdapterTestResult]Individual test results

A single conformance test result.

FieldTypeDescription
namestrTest name
categorystrTest category
statusstrPass/fail/skip status
messagestr | NoneFailure message
duration_msint | NoneTest duration

Health check results from rocky doctor.

FieldTypeDescription
commandstrCommand that produced this output
overallstrOverall health status
checkslist[HealthCheck]Individual health checks
suggestionslist[str]Improvement suggestions

A single health check result.

FieldTypeDescription
namestrCheck name
statusHealthStatusOne of "healthy", "warning", "critical"
messagestrCheck result message
duration_msintCheck duration

Schema drift detection from rocky drift --detect.

FieldTypeDescription
commandstrCommand that produced this output
tables_checkedintTables checked
tables_driftedintTables with drift
resultslist[DriftTableResult]Per-table drift results

Drift result for a single table.

FieldTypeDescription
tablestrFully qualified table name
drifted_columnslist[DriftedColumn]Columns with type drift
actionDriftActionKindAction taken ("DropAndRecreate", "AlterColumnTypes", "Ignore")

parse_rocky_output(json_str) -> RockyOutput

Section titled “parse_rocky_output(json_str) -> RockyOutput”

Auto-detects the command type from the JSON command field and returns the appropriate Pydantic model. Supports all command types: discover, run, plan, state, compile, lineage, history, test, ci, metrics, optimize, ai, ai_sync, ai_explain, ai_test, validate-migration, test-adapter, doctor, and drift.

from dagster_rocky import parse_rocky_output
with open("rocky-output.json") as f:
result = parse_rocky_output(f.read())
if isinstance(result, RunResult):
print(f"Copied {result.tables_copied} tables")
elif isinstance(result, CompileResult):
print(f"Compiled {result.models} models, errors={result.has_errors}")
elif isinstance(result, DoctorResult):
print(f"Health: {result.overall}")