Skip to content

Commit

Permalink
fix: put TaskRunner back to v1 to enable build
Browse files Browse the repository at this point in the history
  • Loading branch information
mgabelle committed Sep 23, 2024
1 parent df7f374 commit a8e19b3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
9 changes: 6 additions & 3 deletions src/main/java/io/kestra/plugin/dbt/cli/AbstractDbt.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -85,11 +87,12 @@ public abstract class AbstractDbt extends Task implements RunnableTask<ScriptOut
If you change from the default one, be careful to also configure the entrypoint to an empty list if needed."""
)
@Builder.Default
@PluginProperty
@Valid
protected Property<TaskRunner> 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
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/kestra/plugin/dbt/cli/Setup.java
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/io/kestra/plugin/dbt/cli/BuildTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/io/kestra/plugin/dbt/cli/DbtCLITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a8e19b3

Please sign in to comment.