Skip to content

Commit ba6b550

Browse files
committed
docs(soda): update docs
1 parent 6535aed commit ba6b550

1 file changed

Lines changed: 57 additions & 17 deletions

File tree

src/main/java/io/kestra/plugin/soda/Scan.java

Lines changed: 57 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@
3131
@Getter
3232
@NoArgsConstructor
3333
@Schema(
34-
title = "Run a Soda scan."
34+
title = "Run Soda scan and report results",
35+
description = "Executes SodaCL checks with the provided configuration, writes scan results to internal storage, and emits metrics to Kestra. Uses the soda-core container by default, runs non-verbose unless `verbose` is true, and requires both configuration and checks to be supplied."
3536
)
36-
@Plugin(
37-
examples = {
38-
@Example(
39-
title = "Run a scan on BigQuery.",
40-
full = true,
37+
@Plugin(
38+
examples = {
39+
@Example(
40+
title = "Run a scan on BigQuery.",
41+
full = true,
4142
code = """
4243
id: soda_scan
4344
namespace: company.team
@@ -67,25 +68,59 @@
6768
requirements:
6869
- soda-core-bigquery
6970
"""
70-
)
71-
}
72-
)
71+
),
72+
@Example(
73+
title = "Scan PostgreSQL with variables and verbose output",
74+
full = true,
75+
code = """
76+
id: soda_scan_postgres
77+
namespace: company.team
78+
79+
tasks:
80+
- id: scan_pg
81+
type: io.kestra.plugin.soda.Scan
82+
configuration:
83+
data_source kestra:
84+
type: postgres
85+
connection:
86+
host: localhost
87+
port: 5432
88+
database: app
89+
username: kestra
90+
password: {{ secret('PG_PASSWORD') }}
91+
checks:
92+
checks for users:
93+
- row_count > 0
94+
- missing_count(email) = 0
95+
variables:
96+
env: staging
97+
threshold: 1000
98+
verbose: true
99+
requirements:
100+
- soda-core-postgres
101+
"""
102+
)
103+
}
104+
)
73105
public class Scan extends AbstractSoda implements RunnableTask<Scan.Output> {
74106
@Schema(
75-
title = "The checks file"
107+
title = "SodaCL checks definition",
108+
description = "Required map rendered to `checks.yml` and executed against the `kestra` data source. Follow SodaCL syntax; failing checks mark the task accordingly."
76109
)
77110
@PluginProperty(dynamic = true)
78111
@NotNull
79112
@NotEmpty
80113
Map<String, Object> checks;
81114

82115
@Schema(
83-
title = "The variables to pass"
116+
title = "Runtime variables",
117+
description = "Optional variables injected into the Soda scan for templating checks or configuration; values are rendered by Kestra before execution."
84118
)
85119
Property<Map<String, Object>> variables;
86120

87121
@Schema(
88-
title = "Whether to enable verbose logging"
122+
title = "Enable verbose logging",
123+
description = "Defaults to false; when true, the Soda scan runs with verbose output."
89124
)
90125
@Builder.Default
91126
Property<Boolean> verbose = Property.ofValue(false);
@@ -181,28 +216,33 @@ protected ScanResult parseResult(RunContext runContext, ScriptOutput output) thr
181216
@Getter
182217
public static class Output implements io.kestra.core.models.tasks.Output {
183218
@Schema(
184-
title = "The scan result"
219+
title = "Scan results payload",
220+
description = "Parsed Soda scan outcome including warnings, failures, and emitted metrics."
185221
)
186222
private final ScanResult result;
187223

188224
@Schema(
189-
title = "The standard output line count"
225+
title = "Standard output line count",
226+
description = "Number of lines captured from stdout during the scan execution."
190227
)
191228
private final int stdOutLineCount;
192229

193230
@Schema(
194-
title = "The standard error line count"
231+
title = "Standard error line count",
232+
description = "Number of lines captured from stderr during the scan execution."
195233
)
196234
private final int stdErrLineCount;
197235

198236
@Schema(
199-
title = "The exit code of the whole execution"
237+
title = "Scan process exit code",
238+
description = "Exit code returned by the underlying Soda command (0 for success, non-zero on failure)."
200239
)
201240
@NotNull
202241
private final int exitCode;
203242

204243
@Schema(
205-
title = "The used configuration"
244+
title = "Rendered configuration",
245+
description = "Configuration map applied to the Soda scan, as rendered by Kestra expressions."
206246
)
207247
@NotNull
208248
private Map<String, Object> configuration;

0 commit comments

Comments
 (0)