Skip to content

Commit

Permalink
source-biguqery-batch: Test suite fixes
Browse files Browse the repository at this point in the history
Updates test snapshots and fixes some tests which weren't fully
reproducible before.
  • Loading branch information
willdonnelly committed Feb 24, 2025
1 parent 2fc413b commit c03cf7d
Show file tree
Hide file tree
Showing 23 changed files with 118 additions and 223 deletions.
40 changes: 0 additions & 40 deletions source-bigquery-batch/.snapshots/TestAsyncCapture-Capture

This file was deleted.

57 changes: 0 additions & 57 deletions source-bigquery-batch/.snapshots/TestAsyncCapture-Discovery

This file was deleted.

3 changes: 2 additions & 1 deletion source-bigquery-batch/.snapshots/TestBinaryTypes-Discovery
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ Binding 0:
{
"resource_config_json": {
"name": "binarytypes_537491",
"template": "{{/* Default query template which adapts to cursor field selection */}}\n{{- if not .CursorFields -}}\n SELECT * FROM `testdata`.`binarytypes_537491`;\n{{- else -}}\n SELECT * FROM `testdata`.`binarytypes_537491`\n {{- if not .IsFirstQuery -}}\n\t{{- range $i, $k := $.CursorFields -}}\n\t {{- if eq $i 0}} WHERE ({{else}}) OR ({{end -}}\n {{- range $j, $n := $.CursorFields -}}\n\t\t{{- if lt $j $i -}}\n\t\t {{$n}} = @p{{$j}} AND {{end -}}\n\t {{- end -}}\n\t {{$k}} \u003e @p{{$i}}\n\t{{- end -}})\n {{- end}}\n ORDER BY {{range $i, $k := $.CursorFields}}{{if gt $i 0}}, {{end}}{{$k}}{{end -}};\n{{- end}}",
"schema": "testdata",
"table": "binarytypes_537491",
"cursor": [
"id"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ Binding 0:
{
"resource_config_json": {
"name": "capturewithdatetimecursor_877736",
"template": "{{/* Default query template which adapts to cursor field selection */}}\n{{- if not .CursorFields -}}\n SELECT * FROM `testdata`.`capturewithdatetimecursor_877736`;\n{{- else -}}\n SELECT * FROM `testdata`.`capturewithdatetimecursor_877736`\n {{- if not .IsFirstQuery -}}\n\t{{- range $i, $k := $.CursorFields -}}\n\t {{- if eq $i 0}} WHERE ({{else}}) OR ({{end -}}\n {{- range $j, $n := $.CursorFields -}}\n\t\t{{- if lt $j $i -}}\n\t\t {{$n}} = @p{{$j}} AND {{end -}}\n\t {{- end -}}\n\t {{$k}} \u003e @p{{$i}}\n\t{{- end -}})\n {{- end}}\n ORDER BY {{range $i, $k := $.CursorFields}}{{if gt $i 0}}, {{end}}{{$k}}{{end -}};\n{{- end}}",
"schema": "testdata",
"table": "capturewithdatetimecursor_877736",
"cursor": [
"updated_at"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ Binding 0:
{
"resource_config_json": {
"name": "capturewithemptypoll_890703",
"template": "{{/* Default query template which adapts to cursor field selection */}}\n{{- if not .CursorFields -}}\n SELECT * FROM `testdata`.`capturewithemptypoll_890703`;\n{{- else -}}\n SELECT * FROM `testdata`.`capturewithemptypoll_890703`\n {{- if not .IsFirstQuery -}}\n\t{{- range $i, $k := $.CursorFields -}}\n\t {{- if eq $i 0}} WHERE ({{else}}) OR ({{end -}}\n {{- range $j, $n := $.CursorFields -}}\n\t\t{{- if lt $j $i -}}\n\t\t {{$n}} = @p{{$j}} AND {{end -}}\n\t {{- end -}}\n\t {{$k}} \u003e @p{{$i}}\n\t{{- end -}})\n {{- end}}\n ORDER BY {{range $i, $k := $.CursorFields}}{{if gt $i 0}}, {{end}}{{$k}}{{end -}};\n{{- end}}",
"schema": "testdata",
"table": "capturewithemptypoll_890703",
"cursor": [
"updated_at"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ Binding 0:
{
"resource_config_json": {
"name": "capturewithmodifications_786099",
"template": "{{/* Default query template which adapts to cursor field selection */}}\n{{- if not .CursorFields -}}\n SELECT * FROM `testdata`.`capturewithmodifications_786099`;\n{{- else -}}\n SELECT * FROM `testdata`.`capturewithmodifications_786099`\n {{- if not .IsFirstQuery -}}\n\t{{- range $i, $k := $.CursorFields -}}\n\t {{- if eq $i 0}} WHERE ({{else}}) OR ({{end -}}\n {{- range $j, $n := $.CursorFields -}}\n\t\t{{- if lt $j $i -}}\n\t\t {{$n}} = @p{{$j}} AND {{end -}}\n\t {{- end -}}\n\t {{$k}} \u003e @p{{$i}}\n\t{{- end -}})\n {{- end}}\n ORDER BY {{range $i, $k := $.CursorFields}}{{if gt $i 0}}, {{end}}{{$k}}{{end -}};\n{{- end}}",
"schema": "testdata",
"table": "capturewithmodifications_786099",
"cursor": [
"updated_at"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# ================================
# Collection "acmeCo/test/capturewithnullcursor_662607": 7 Documents
# Collection "acmeCo/test/capturewithnullcursor_662607": 5 Documents
# ================================
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value with NULL cursor","id":0,"sort_col":null}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Third NULL cursor","id":4,"sort_col":null}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Another NULL cursor","id":2,"sort_col":null}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Third NULL cursor","id":4,"sort_col":null}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value with NULL cursor","id":0,"sort_col":null}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value with cursor 10","id":1,"sort_col":10}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value with cursor 20","id":3,"sort_col":20}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value with cursor 25","id":7,"sort_col":25}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Final value cursor 30","id":9,"sort_col":30}
# ================================
# Final State Checkpoint
# ================================
{"bindingStateV1":{"capturewithnullcursor_662607":{"CursorNames":["sort_col"],"CursorValues":[30],"LastPolled":"<TIMESTAMP>"}}}
{"bindingStateV1":{"capturewithnullcursor_662607":{"CursorNames":["sort_col"],"CursorValues":[20],"LastPolled":"<TIMESTAMP>"}}}

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# ================================
# Collection "acmeCo/test/capturewithnullcursor_662607": 2 Documents
# ================================
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Final value cursor 30","id":9,"sort_col":30}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value with cursor 25","id":7,"sort_col":25}
# ================================
# Final State Checkpoint
# ================================
{"bindingStateV1":{"capturewithnullcursor_662607":{"CursorNames":["sort_col"],"CursorValues":[30],"LastPolled":"<TIMESTAMP>"}}}

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ Binding 0:
{
"resource_config_json": {
"name": "capturewithnullcursor_662607",
"template": "{{/* Default query template which adapts to cursor field selection */}}\n{{- if not .CursorFields -}}\n SELECT * FROM `testdata`.`capturewithnullcursor_662607`;\n{{- else -}}\n SELECT * FROM `testdata`.`capturewithnullcursor_662607`\n {{- if not .IsFirstQuery -}}\n\t{{- range $i, $k := $.CursorFields -}}\n\t {{- if eq $i 0}} WHERE ({{else}}) OR ({{end -}}\n {{- range $j, $n := $.CursorFields -}}\n\t\t{{- if lt $j $i -}}\n\t\t {{$n}} = @p{{$j}} AND {{end -}}\n\t {{- end -}}\n\t {{$k}} \u003e @p{{$i}}\n\t{{- end -}})\n {{- end}}\n ORDER BY {{range $i, $k := $.CursorFields}}{{if gt $i 0}}, {{end}}{{$k}}{{end -}};\n{{- end}}",
"schema": "testdata",
"table": "capturewithnullcursor_662607",
"cursor": [
"sort_col"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ Binding 0:
{
"resource_config_json": {
"name": "capturewithtwocolumncursor_321285",
"template": "{{/* Default query template which adapts to cursor field selection */}}\n{{- if not .CursorFields -}}\n SELECT * FROM `testdata`.`capturewithtwocolumncursor_321285`;\n{{- else -}}\n SELECT * FROM `testdata`.`capturewithtwocolumncursor_321285`\n {{- if not .IsFirstQuery -}}\n\t{{- range $i, $k := $.CursorFields -}}\n\t {{- if eq $i 0}} WHERE ({{else}}) OR ({{end -}}\n {{- range $j, $n := $.CursorFields -}}\n\t\t{{- if lt $j $i -}}\n\t\t {{$n}} = @p{{$j}} AND {{end -}}\n\t {{- end -}}\n\t {{$k}} \u003e @p{{$i}}\n\t{{- end -}})\n {{- end}}\n ORDER BY {{range $i, $k := $.CursorFields}}{{if gt $i 0}}, {{end}}{{$k}}{{end -}};\n{{- end}}",
"schema": "testdata",
"table": "capturewithtwocolumncursor_321285",
"cursor": [
"col1",
"col2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ Binding 0:
{
"resource_config_json": {
"name": "capturewithupdatedatcursor_792371",
"template": "{{/* Default query template which adapts to cursor field selection */}}\n{{- if not .CursorFields -}}\n SELECT * FROM `testdata`.`capturewithupdatedatcursor_792371`;\n{{- else -}}\n SELECT * FROM `testdata`.`capturewithupdatedatcursor_792371`\n {{- if not .IsFirstQuery -}}\n\t{{- range $i, $k := $.CursorFields -}}\n\t {{- if eq $i 0}} WHERE ({{else}}) OR ({{end -}}\n {{- range $j, $n := $.CursorFields -}}\n\t\t{{- if lt $j $i -}}\n\t\t {{$n}} = @p{{$j}} AND {{end -}}\n\t {{- end -}}\n\t {{$k}} \u003e @p{{$i}}\n\t{{- end -}})\n {{- end}}\n ORDER BY {{range $i, $k := $.CursorFields}}{{if gt $i 0}}, {{end}}{{$k}}{{end -}};\n{{- end}}",
"schema": "testdata",
"table": "capturewithupdatedatcursor_792371",
"cursor": [
"updated_at"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ Binding 0:
{
"resource_config_json": {
"name": "compositetypes_483529",
"template": "{{/* Default query template which adapts to cursor field selection */}}\n{{- if not .CursorFields -}}\n SELECT * FROM `testdata`.`compositetypes_483529`;\n{{- else -}}\n SELECT * FROM `testdata`.`compositetypes_483529`\n {{- if not .IsFirstQuery -}}\n\t{{- range $i, $k := $.CursorFields -}}\n\t {{- if eq $i 0}} WHERE ({{else}}) OR ({{end -}}\n {{- range $j, $n := $.CursorFields -}}\n\t\t{{- if lt $j $i -}}\n\t\t {{$n}} = @p{{$j}} AND {{end -}}\n\t {{- end -}}\n\t {{$k}} \u003e @p{{$i}}\n\t{{- end -}})\n {{- end}}\n ORDER BY {{range $i, $k := $.CursorFields}}{{if gt $i 0}}, {{end}}{{$k}}{{end -}};\n{{- end}}",
"schema": "testdata",
"table": "compositetypes_483529",
"cursor": [
"id"
]
Expand Down
12 changes: 12 additions & 0 deletions source-bigquery-batch/.snapshots/TestFullRefresh-Capture1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# ================================
# Collection "acmeCo/test/fullrefresh_902536": 4 Documents
# ================================
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 0","id":0}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 1","id":1}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 2","id":2}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 3","id":3}
# ================================
# Final State Checkpoint
# ================================
{"bindingStateV1":{"fullrefresh_902536":{"CursorNames":null,"CursorValues":null,"LastPolled":"<TIMESTAMP>"}}}

Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
# ================================
# Collection "acmeCo/test/fullrefresh_902536": 12 Documents
# Collection "acmeCo/test/fullrefresh_902536": 8 Documents
# ================================
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 3","id":3}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 0","id":0}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 2","id":2}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 1","id":1}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 2","id":2}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 3","id":3}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 4","id":4}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 1","id":1}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 2","id":2}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 5","id":5}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 7","id":7}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 0","id":0}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 6","id":6}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 7","id":7}
# ================================
# Final State Checkpoint
# ================================
Expand Down
3 changes: 2 additions & 1 deletion source-bigquery-batch/.snapshots/TestFullRefresh-Discovery
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ Binding 0:
{
"resource_config_json": {
"name": "fullrefresh_902536",
"template": "{{/* Default query template which adapts to cursor field selection */}}\n{{- if not .CursorFields -}}\n SELECT * FROM `testdata`.`fullrefresh_902536`;\n{{- else -}}\n SELECT * FROM `testdata`.`fullrefresh_902536`\n {{- if not .IsFirstQuery -}}\n\t{{- range $i, $k := $.CursorFields -}}\n\t {{- if eq $i 0}} WHERE ({{else}}) OR ({{end -}}\n {{- range $j, $n := $.CursorFields -}}\n\t\t{{- if lt $j $i -}}\n\t\t {{$n}} = @p{{$j}} AND {{end -}}\n\t {{- end -}}\n\t {{$k}} \u003e @p{{$i}}\n\t{{- end -}})\n {{- end}}\n ORDER BY {{range $i, $k := $.CursorFields}}{{if gt $i 0}}, {{end}}{{$k}}{{end -}};\n{{- end}}"
"schema": "testdata",
"table": "fullrefresh_902536"
},
"resource_path": [
"fullrefresh_902536"
Expand Down
3 changes: 2 additions & 1 deletion source-bigquery-batch/.snapshots/TestIntegerTypes-Discovery
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ Binding 0:
{
"resource_config_json": {
"name": "integertypes_795898",
"template": "{{/* Default query template which adapts to cursor field selection */}}\n{{- if not .CursorFields -}}\n SELECT * FROM `testdata`.`integertypes_795898`;\n{{- else -}}\n SELECT * FROM `testdata`.`integertypes_795898`\n {{- if not .IsFirstQuery -}}\n\t{{- range $i, $k := $.CursorFields -}}\n\t {{- if eq $i 0}} WHERE ({{else}}) OR ({{end -}}\n {{- range $j, $n := $.CursorFields -}}\n\t\t{{- if lt $j $i -}}\n\t\t {{$n}} = @p{{$j}} AND {{end -}}\n\t {{- end -}}\n\t {{$k}} \u003e @p{{$i}}\n\t{{- end -}})\n {{- end}}\n ORDER BY {{range $i, $k := $.CursorFields}}{{if gt $i 0}}, {{end}}{{$k}}{{end -}};\n{{- end}}",
"schema": "testdata",
"table": "integertypes_795898",
"cursor": [
"id"
]
Expand Down
3 changes: 2 additions & 1 deletion source-bigquery-batch/.snapshots/TestJSONType-Discovery
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ Binding 0:
{
"resource_config_json": {
"name": "jsontype_519262",
"template": "{{/* Default query template which adapts to cursor field selection */}}\n{{- if not .CursorFields -}}\n SELECT * FROM `testdata`.`jsontype_519262`;\n{{- else -}}\n SELECT * FROM `testdata`.`jsontype_519262`\n {{- if not .IsFirstQuery -}}\n\t{{- range $i, $k := $.CursorFields -}}\n\t {{- if eq $i 0}} WHERE ({{else}}) OR ({{end -}}\n {{- range $j, $n := $.CursorFields -}}\n\t\t{{- if lt $j $i -}}\n\t\t {{$n}} = @p{{$j}} AND {{end -}}\n\t {{- end -}}\n\t {{$k}} \u003e @p{{$i}}\n\t{{- end -}})\n {{- end}}\n ORDER BY {{range $i, $k := $.CursorFields}}{{if gt $i 0}}, {{end}}{{$k}}{{end -}};\n{{- end}}",
"schema": "testdata",
"table": "jsontype_519262",
"cursor": [
"id"
]
Expand Down
3 changes: 2 additions & 1 deletion source-bigquery-batch/.snapshots/TestNumericTypes-Discovery
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ Binding 0:
{
"resource_config_json": {
"name": "numerictypes_559424",
"template": "{{/* Default query template which adapts to cursor field selection */}}\n{{- if not .CursorFields -}}\n SELECT * FROM `testdata`.`numerictypes_559424`;\n{{- else -}}\n SELECT * FROM `testdata`.`numerictypes_559424`\n {{- if not .IsFirstQuery -}}\n\t{{- range $i, $k := $.CursorFields -}}\n\t {{- if eq $i 0}} WHERE ({{else}}) OR ({{end -}}\n {{- range $j, $n := $.CursorFields -}}\n\t\t{{- if lt $j $i -}}\n\t\t {{$n}} = @p{{$j}} AND {{end -}}\n\t {{- end -}}\n\t {{$k}} \u003e @p{{$i}}\n\t{{- end -}})\n {{- end}}\n ORDER BY {{range $i, $k := $.CursorFields}}{{if gt $i 0}}, {{end}}{{$k}}{{end -}};\n{{- end}}",
"schema": "testdata",
"table": "numerictypes_559424",
"cursor": [
"id"
]
Expand Down
Loading

0 comments on commit c03cf7d

Please sign in to comment.