Skip to content

Commit 4cfa99c

Browse files
authored
fix: replace deprecated Property<> constructor with Property.ofValue/ofExpression (#251)
* fix: replace deprecated Property<> constructor with Property.ofValue/ofExpression * fix: correct Property.ofValue/ofExpression type mismatches and rendering issues * fix: remove unused JacksonMapper import * fix: use ofExpression for values containing Pebble expressions * fix: use ofExpression for dbt commands containing {{workingDir}} --------- Co-authored-by: François Delbrayelle <fdelbrayelle@kestra.io>
1 parent 4b39b4b commit 4cfa99c

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/main/java/io/kestra/plugin/dbt/cli/AbstractDbt.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public void accept(String line, Boolean isStdErr) {
194194
)
195195
.withInterpreter(Property.ofValue(List.of("/bin/sh", "-c")))
196196
.withCommands(
197-
new Property<>(
197+
Property.ofExpression(
198198
JacksonMapper.ofJson().writeValueAsString(
199199
List.of(createDbtCommand(runContext))
200200
)

src/test/java/io/kestra/plugin/dbt/cli/DbtCLITest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ void testDbtCliWithStoreManifest_manifestShouldBePresentInKvStore() throws Excep
116116
.storeManifest(
117117
DbtCLI.KvStoreManifest.builder()
118118
.key(Property.ofValue(MANIFEST_KEY))
119-
.namespace(new Property<>(FLOW_NAMESPACE))
119+
.namespace(Property.ofExpression(FLOW_NAMESPACE))
120120
.build()
121121
)
122122
.build();
@@ -149,7 +149,7 @@ void testDbtWithLoadManifest_manifestShouldBeLoadedFromKvStore() throws Exceptio
149149
.loadManifest(
150150
DbtCLI.KvStoreManifest.builder()
151151
.key(Property.ofValue(MANIFEST_KEY))
152-
.namespace(new Property<>(FLOW_NAMESPACE))
152+
.namespace(Property.ofExpression(FLOW_NAMESPACE))
153153
.build()
154154
)
155155
.build();
@@ -192,7 +192,7 @@ void run_withLoadManifestString_shouldWriteJsonObjectManifest() throws Exception
192192
.loadManifest(
193193
DbtCLI.KvStoreManifest.builder()
194194
.key(Property.ofValue(MANIFEST_KEY))
195-
.namespace(new Property<>(FLOW_NAMESPACE))
195+
.namespace(Property.ofExpression(FLOW_NAMESPACE))
196196
.build()
197197
)
198198
.build();

0 commit comments

Comments
 (0)