diff --git a/src/main/java/io/kestra/plugin/dbt/cli/AbstractDbt.java b/src/main/java/io/kestra/plugin/dbt/cli/AbstractDbt.java index 61445b6..1dfcfdd 100644 --- a/src/main/java/io/kestra/plugin/dbt/cli/AbstractDbt.java +++ b/src/main/java/io/kestra/plugin/dbt/cli/AbstractDbt.java @@ -2,6 +2,8 @@ import com.fasterxml.jackson.annotation.JsonSetter; import io.kestra.core.exceptions.IllegalVariableEvaluationException; +import io.kestra.core.models.annotations.Plugin; +import io.kestra.core.models.annotations.PluginProperty; import io.kestra.core.models.property.Property; import io.kestra.core.models.tasks.*; import io.kestra.core.models.tasks.runners.AbstractLogConsumer; @@ -85,11 +87,12 @@ public abstract class AbstractDbt extends Task implements RunnableTask taskRunner = Property.of(Docker.builder() + protected TaskRunner taskRunner = Docker.builder() .type(Docker.class.getName()) .entryPoint(Collections.emptyList()) - .build()); + .build(); @Schema(title = "The task runner container image, only used if the task runner is container-based.") @Builder.Default @@ -148,7 +151,7 @@ public ScriptOutput run(RunContext runContext) throws Exception { .withRunnerType(this.getRunner().as(runContext, RunnerType.class)) .withDockerOptions(this.getDocker().as(runContext, DockerOptions.class)) .withContainerImage(this.containerImage.as(runContext, String.class)) - .withTaskRunner(this.taskRunner.as(runContext, TaskRunner.class)) + .withTaskRunner(this.taskRunner) .withLogConsumer(new AbstractLogConsumer() { @Override public void accept(String line, Boolean isStdErr) { diff --git a/src/main/java/io/kestra/plugin/dbt/cli/Setup.java b/src/main/java/io/kestra/plugin/dbt/cli/Setup.java index 432d71f..03b1ff4 100644 --- a/src/main/java/io/kestra/plugin/dbt/cli/Setup.java +++ b/src/main/java/io/kestra/plugin/dbt/cli/Setup.java @@ -181,7 +181,7 @@ public ScriptOutput run(RunContext runContext) throws Exception { // noinspection ResultOfMethodCallIgnored profileDir.mkdirs(); - String profilesContent = profilesContent(runContext, profiles); + String profilesContent = profilesContent(runContext, profiles.as(runContext, Object.class)); FileUtils.writeStringToFile( new File(profileDir, "profiles.yml"), profilesContent, diff --git a/src/test/java/io/kestra/plugin/dbt/cli/BuildTest.java b/src/test/java/io/kestra/plugin/dbt/cli/BuildTest.java index 7e88944..a53ad50 100644 --- a/src/test/java/io/kestra/plugin/dbt/cli/BuildTest.java +++ b/src/test/java/io/kestra/plugin/dbt/cli/BuildTest.java @@ -79,7 +79,7 @@ void run() throws Exception { env.put("GOOGLE_APPLICATION_CREDENTIALS", runContext.workingDir().resolve(Path.of("sa.json")).toString()); Build task = Build.builder() .thread((Property.of(8))) - .taskRunner(Property.of(Process.instance())) + .taskRunner(Process.instance()) .env(Property.of(env)) .build(); diff --git a/src/test/java/io/kestra/plugin/dbt/cli/DbtCLITest.java b/src/test/java/io/kestra/plugin/dbt/cli/DbtCLITest.java index cd45af4..1209737 100644 --- a/src/test/java/io/kestra/plugin/dbt/cli/DbtCLITest.java +++ b/src/test/java/io/kestra/plugin/dbt/cli/DbtCLITest.java @@ -53,7 +53,7 @@ void run() throws Exception { location: US method: service-account priority: interactive - project: kestra-dev + project: kestra-unit-test threads: 1 timeout_seconds: 300 type: bigquery