Skip to content

Commit

Permalink
fix(tests): fix BigQuery test (#83)
Browse files Browse the repository at this point in the history
* fix(tests): fix BigQuery test

* fix(tests): fix BigQuery test - mapping issue
  • Loading branch information
mgabelle authored Dec 2, 2024
1 parent bdf5cd2 commit 41a04bd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ public class DiscoverMetadata {
@JsonProperty("sql-datatype")
String sqlDatatype;

@JsonProperty("table")
String table;

@JsonProperty("columns")
List<String> columns;

@JsonProperty("datetime_key")
String datetime_key;

@Getter(AccessLevel.NONE)
Map<String, Object> extra;

Expand Down
5 changes: 3 additions & 2 deletions src/test/java/io/kestra/plugin/singer/taps/BigQueryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import io.kestra.core.utils.IdUtils;
import io.kestra.core.utils.TestsUtils;
import io.kestra.plugin.core.runner.Process;
import io.kestra.plugin.scripts.runner.docker.Docker;
import io.kestra.plugin.singer.models.DiscoverMetadata;
import io.kestra.plugin.singer.models.StreamsConfiguration;
import jakarta.inject.Inject;
Expand All @@ -32,7 +33,7 @@ void run() throws Exception {

BigQuery.BigQueryBuilder<?, ?> builder = BigQuery.builder()
.id(IdUtils.create())
.taskRunner(Process.instance())
.taskRunner(Docker.instance())
.type(BigQuery.class.getName())
.serviceAccount(serviceAccount)
.startAlwaysInclusive(false)
Expand Down Expand Up @@ -67,7 +68,7 @@ void run() throws Exception {

assertThat(groupedByType.get(StreamType.SCHEMA).size(), is(1));
assertThat(groupedByType.get(StreamType.SCHEMA).get(0).get("stream"), is("covid19_nyt_us_states"));
assertThat(groupedByType.get(StreamType.RECORD).size(), is(17));
assertThat(groupedByType.get(StreamType.RECORD).size(), is(61942));
assertThat(groupedByType.get(StreamType.STATE).size(), is(2));

// rerun, since we have startAlwaysInclusive false, we won't retrieve any record
Expand Down

0 comments on commit 41a04bd

Please sign in to comment.