Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

source-postgres-batch: Paying down some technical debt #2406

Merged
merged 4 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ jobs:
"source-kinesis",
"source-mysql",
"source-postgres",
"source-postgres-batch",
"source-sftp",
"source-sqlserver",
"source-mongodb"
Expand Down Expand Up @@ -221,7 +222,7 @@ jobs:
uses: actions/setup-python@v5
if: ${{matrix.python}}
with:
python-version: '3.11'
python-version: '3.11'

- name: Install Poetry
if: ${{matrix.python}}
Expand Down
18 changes: 18 additions & 0 deletions source-postgres-batch/.snapshots/TestArrayTypes-Capture
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# ================================
# Collection "acmeCo/test/test_arraytypes_371544": 10 Documents
# ================================
{"_meta":{"polled":"<TIMESTAMP>","index":999},"id":0,"int_array":"{1,2,3}","real_array":"{1.1,2.2,3.3}","text_array":"{one,two,three}","txid":999999,"uuid_array":"{550e8400-e29b-41d4-a716-446655440000,6ba7b810-9dad-11d1-80b4-00c04fd430c8}"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"id":1,"int_array":"{}","real_array":"{}","text_array":"{}","txid":999999,"uuid_array":"{}"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"id":2,"int_array":"{1,NULL,3}","real_array":"{1.1,NULL,3.3}","text_array":"{one,NULL,three}","txid":999999,"uuid_array":"{550e8400-e29b-41d4-a716-446655440000,NULL}"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"id":3,"int_array":"{{1,2},{3,4}}","real_array":"{{1.1,2.2},{3.3,4.4}}","text_array":"{{a,b},{c,d}}","txid":999999,"uuid_array":"{{550e8400-e29b-41d4-a716-446655440000},{6ba7b810-9dad-11d1-80b4-00c04fd430c8}}"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"id":4,"int_array":"{2147483647,-2147483648}","real_array":"{Infinity,-Infinity,NaN}","text_array":"{linenbreak,tabthere,\"quote\\\"mark\"}","txid":999999,"uuid_array":"{00000000-0000-0000-0000-000000000000,ffffffff-ffff-ffff-ffff-ffffffffffff}"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"id":5,"int_array":"{42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42}","real_array":"{3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14,3.14}","text_array":"{text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text}","txid":999999,"uuid_array":"{550e8400-e29b-41d4-a716-446655440000,550e8400-e29b-41d4-a716-446655440000,550e8400-e29b-41d4-a716-446655440000,550e8400-e29b-41d4-a716-446655440000,550e8400-e29b-41d4-a716-446655440000,550e8400-e29b-41d4-a716-446655440000,550e8400-e29b-41d4-a716-446655440000,550e8400-e29b-41d4-a716-446655440000,550e8400-e29b-41d4-a716-446655440000,550e8400-e29b-41d4-a716-446655440000}"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"id":6,"int_array":"{1234,5678}","real_array":"{1.234,5.678}","text_array":"{\"Hello, World!\",\"Contains \\\"quotes\\\"\",\"Special chars: @#$%\"}","txid":999999,"uuid_array":"{550e8400-e29b-41d4-a716-446655440000}"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"id":7,"int_array":"{789,12}","real_array":"{7.89,0.12}","text_array":"{\"Hello 世界\",\"Привет мир\",🌍🌎🌏}","txid":999999,"uuid_array":"{6ba7b810-9dad-11d1-80b4-00c04fd430c8}"}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"id":8,"int_array":null,"real_array":null,"text_array":null,"txid":999999,"uuid_array":null}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"id":9,"int_array":"{42}","real_array":"{3.14159}","text_array":"{\"single element\"}","txid":999999,"uuid_array":"{550e8400-e29b-41d4-a716-446655440000}"}
# ================================
# Final State Checkpoint
# ================================
{"bindingStateV1":{"test_arraytypes_371544":{"CursorNames":["txid"],"CursorValues":[999999],"LastPolled":"<TIMESTAMP>"}}}

Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
Binding 0:
{
"resource_config_json": {
"name": "test_basic_capture_826935",
"name": "test_arraytypes_371544",
"schema": "test",
"table": "basic_capture_826935",
"table": "arraytypes_371544",
"cursor": [
"txid"
]
},
"resource_path": [
"test_basic_capture_826935"
"test_arraytypes_371544"
],
"collection": {
"name": "acmeCo/test/test_basic_capture_826935",
"name": "acmeCo/test/test_arraytypes_371544",
"read_schema_json": {
"type": "object",
"required": [
Expand Down Expand Up @@ -53,6 +53,6 @@ Binding 0:
],
"projections": null
},
"state_key": "test_basic_capture_826935"
"state_key": "test_arraytypes_371544"
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ================================
# Collection "acmeCo/test/test_basic_capture_826935": 250 Documents
# Collection "acmeCo/test/test_asynccapture_817595": 250 Documents
# ================================
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 0","id":0,"txid":999999}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 1","id":1,"txid":999999}
Expand Down Expand Up @@ -254,5 +254,5 @@
# ================================
# Final State Checkpoint
# ================================
{"bindingStateV1":{"test_basic_capture_826935":{"CursorNames":["txid"],"CursorValues":[999999],"LastPolled":"<TIMESTAMP>"}}}
{"bindingStateV1":{"test_asynccapture_817595":{"CursorNames":["txid"],"CursorValues":[999999],"LastPolled":"<TIMESTAMP>"}}}

Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
Binding 0:
{
"resource_config_json": {
"name": "test_basic_datatypes_13111208",
"name": "test_asynccapture_817595",
"schema": "test",
"table": "basic_datatypes_13111208",
"table": "asynccapture_817595",
"cursor": [
"txid"
]
},
"resource_path": [
"test_basic_datatypes_13111208"
"test_asynccapture_817595"
],
"collection": {
"name": "acmeCo/test/test_basic_datatypes_13111208",
"name": "acmeCo/test/test_asynccapture_817595",
"read_schema_json": {
"type": "object",
"required": [
Expand Down Expand Up @@ -53,6 +53,6 @@ Binding 0:
],
"projections": null
},
"state_key": "test_basic_datatypes_13111208"
"state_key": "test_asynccapture_817595"
}

9 changes: 0 additions & 9 deletions source-postgres-batch/.snapshots/TestBasicDatatypes-Capture

This file was deleted.

17 changes: 17 additions & 0 deletions source-postgres-batch/.snapshots/TestBinaryTypes-Capture
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# ================================
# Collection "acmeCo/test/test_binarytypes_537491": 9 Documents
# ================================
{"_meta":{"polled":"<TIMESTAMP>","index":999},"bit3_col":"101","bit_col":"1","bitvar5_col":"10101","bitvar_col":"1010","bool_col":true,"bytea_col":"SGVsbG8=","id":0,"txid":999999}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"bit3_col":"000","bit_col":"0","bitvar5_col":"00000","bitvar_col":"0","bool_col":false,"bytea_col":"AAAA","id":1,"txid":999999}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"bit3_col":"111","bit_col":"1","bitvar5_col":"11111","bitvar_col":"111111","bool_col":true,"bytea_col":"////","id":2,"txid":999999}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"bit3_col":"110","bit_col":"0","bitvar5_col":"10110","bitvar_col":"1100","bool_col":true,"bytea_col":"qrvM","id":3,"txid":999999}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"bit3_col":"000","bit_col":"0","bitvar5_col":"","bitvar_col":"","bool_col":false,"bytea_col":"","id":4,"txid":999999}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"bit3_col":null,"bit_col":null,"bitvar5_col":null,"bitvar_col":null,"bool_col":null,"bytea_col":null,"id":5,"txid":999999}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"bit3_col":"101","bit_col":"1","bitvar5_col":"10101","bitvar_col":"1010","bool_col":true,"bytea_col":"AAECAwQF/w==","id":6,"txid":999999}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"bit3_col":"010","bit_col":"0","bitvar5_col":"01010","bitvar_col":"0101","bool_col":false,"bytea_col":"SGVsbG8g5LiW55WM","id":7,"txid":999999}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"bit3_col":"111","bit_col":"1","bitvar5_col":"11111","bitvar_col":"1111","bool_col":true,"bytea_col":"AP9/gAEjRWeJq83v","id":8,"txid":999999}
# ================================
# Final State Checkpoint
# ================================
{"bindingStateV1":{"test_binarytypes_537491":{"CursorNames":["txid"],"CursorValues":[999999],"LastPolled":"<TIMESTAMP>"}}}

58 changes: 58 additions & 0 deletions source-postgres-batch/.snapshots/TestBinaryTypes-Discovery
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Binding 0:
{
"resource_config_json": {
"name": "test_binarytypes_537491",
"schema": "test",
"table": "binarytypes_537491",
"cursor": [
"txid"
]
},
"resource_path": [
"test_binarytypes_537491"
],
"collection": {
"name": "acmeCo/test/test_binarytypes_537491",
"read_schema_json": {
"type": "object",
"required": [
"_meta",
"id"
],
"properties": {
"_meta": {
"$schema": "http://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/estuary/connectors/source-postgres-batch/document-metadata",
"properties": {
"polled": {
"type": "string",
"format": "date-time",
"title": "Polled Timestamp",
"description": "The time at which the update query which produced this document as executed."
},
"index": {
"type": "integer",
"title": "Result Index",
"description": "The index of this document within the query execution which produced it."
}
},
"type": "object",
"required": [
"polled",
"index"
]
},
"id": {
"type": "integer"
}
},
"x-infer-schema": true
},
"key": [
"/id"
],
"projections": null
},
"state_key": "test_binarytypes_537491"
}

18 changes: 18 additions & 0 deletions source-postgres-batch/.snapshots/TestCaptureWithEmptyPoll-Capture
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# ================================
# Collection "acmeCo/test/test_capturewithemptypoll_890703": 10 Documents
# ================================
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 0","id":0,"txid":999999}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 1","id":1,"txid":999999}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 2","id":2,"txid":999999}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 3","id":3,"txid":999999}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 4","id":4,"txid":999999}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 5","id":5,"txid":999999}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 6","id":6,"txid":999999}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 7","id":7,"txid":999999}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 8","id":8,"txid":999999}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"data":"Value for row 9","id":9,"txid":999999}
# ================================
# Final State Checkpoint
# ================================
{"bindingStateV1":{"test_capturewithemptypoll_890703":{"CursorNames":["txid"],"CursorValues":[999999],"LastPolled":"<TIMESTAMP>"}}}

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Binding 0:
{
"resource_config_json": {
"name": "test_capturewithemptypoll_890703",
"schema": "test",
"table": "capturewithemptypoll_890703",
"cursor": [
"txid"
]
},
"resource_path": [
"test_capturewithemptypoll_890703"
],
"collection": {
"name": "acmeCo/test/test_capturewithemptypoll_890703",
"read_schema_json": {
"type": "object",
"required": [
"_meta",
"id"
],
"properties": {
"_meta": {
"$schema": "http://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/estuary/connectors/source-postgres-batch/document-metadata",
"properties": {
"polled": {
"type": "string",
"format": "date-time",
"title": "Polled Timestamp",
"description": "The time at which the update query which produced this document as executed."
},
"index": {
"type": "integer",
"title": "Result Index",
"description": "The index of this document within the query execution which produced it."
}
},
"type": "object",
"required": [
"polled",
"index"
]
},
"id": {
"type": "integer"
}
},
"x-infer-schema": true
},
"key": [
"/id"
],
"projections": null
},
"state_key": "test_capturewithemptypoll_890703"
}

18 changes: 18 additions & 0 deletions source-postgres-batch/.snapshots/TestDateAndTimeTypes-Capture
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# ================================
# Collection "acmeCo/test/test_dateandtimetypes_307398": 10 Documents
# ================================
{"_meta":{"polled":"<TIMESTAMP>","index":999},"date_col":"2025-02-14T00:00:00Z","id":0,"interval_col":"1 year 2 mons 3 days 04:05:06","time_col":"14:44:29","timetz_col":"14:44:29-05","ts_col":"2025-02-14T14:44:29Z","tstz_col":"2025-02-14T00:44:29-05:00","txid":999999}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"date_col":"1969-07-20T00:00:00Z","id":1,"interval_col":"50 years","time_col":"20:17:00","timetz_col":"20:17:00-04","ts_col":"1969-07-20T20:17:00Z","tstz_col":"1969-07-20T16:17:00-04:00","txid":999999}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"date_col":"2077-07-20T00:00:00Z","id":2,"interval_col":"100 years","time_col":"15:30:00","timetz_col":"15:30:00+09","ts_col":"2077-07-20T15:30:00Z","tstz_col":"2077-07-20T02:30:00-04:00","txid":999999}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"date_col":"0001-01-01T00:00:00Z","id":3,"interval_col":"00:00:00.000001","time_col":"00:00:00","timetz_col":"00:00:00+00","ts_col":"0001-01-01T00:00:00Z","tstz_col":"0000-12-31T19:03:58-04:56","txid":999999}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"date_col":"9999-12-31T00:00:00Z","id":4,"interval_col":"1000 years","time_col":"23:59:59.999999","timetz_col":"23:59:59.999999+00","ts_col":"9999-12-31T23:59:59.999999Z","tstz_col":"9999-12-31T18:59:59.999999-05:00","txid":999999}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"date_col":"2024-02-14T00:00:00Z","id":5,"interval_col":"-178000000 years","time_col":"15:30:45","timetz_col":"15:30:45+00","ts_col":"2024-02-14T15:30:45Z","tstz_col":"2024-02-14T10:30:45-05:00","txid":999999}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"date_col":"2024-02-14T00:00:00Z","id":6,"interval_col":"178000000 years","time_col":"15:30:45","timetz_col":"15:30:45+00","ts_col":"2024-02-14T15:30:45Z","tstz_col":"2024-02-14T10:30:45-05:00","txid":999999}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"date_col":"2024-02-14T00:00:00Z","id":7,"interval_col":"00:00:01.123456","time_col":"15:30:45.123456","timetz_col":"15:30:45.123456+00","ts_col":"2024-02-14T15:30:45.123456Z","tstz_col":"2024-02-14T10:30:45.123456-05:00","txid":999999}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"date_col":"2024-02-14T00:00:00Z","id":8,"interval_col":"2 years 3 mons 4 days 12:30:45.123456","time_col":"15:30:45","timetz_col":"15:30:45+00","ts_col":"2024-02-14T15:30:45Z","tstz_col":"2024-02-14T10:30:45-05:00","txid":999999}
{"_meta":{"polled":"<TIMESTAMP>","index":999},"date_col":null,"id":9,"interval_col":null,"time_col":null,"timetz_col":null,"ts_col":null,"tstz_col":null,"txid":999999}
# ================================
# Final State Checkpoint
# ================================
{"bindingStateV1":{"test_dateandtimetypes_307398":{"CursorNames":["txid"],"CursorValues":[999999],"LastPolled":"<TIMESTAMP>"}}}

58 changes: 58 additions & 0 deletions source-postgres-batch/.snapshots/TestDateAndTimeTypes-Discovery
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Binding 0:
{
"resource_config_json": {
"name": "test_dateandtimetypes_307398",
"schema": "test",
"table": "dateandtimetypes_307398",
"cursor": [
"txid"
]
},
"resource_path": [
"test_dateandtimetypes_307398"
],
"collection": {
"name": "acmeCo/test/test_dateandtimetypes_307398",
"read_schema_json": {
"type": "object",
"required": [
"_meta",
"id"
],
"properties": {
"_meta": {
"$schema": "http://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/estuary/connectors/source-postgres-batch/document-metadata",
"properties": {
"polled": {
"type": "string",
"format": "date-time",
"title": "Polled Timestamp",
"description": "The time at which the update query which produced this document as executed."
},
"index": {
"type": "integer",
"title": "Result Index",
"description": "The index of this document within the query execution which produced it."
}
},
"type": "object",
"required": [
"polled",
"index"
]
},
"id": {
"type": "integer"
}
},
"x-infer-schema": true
},
"key": [
"/id"
],
"projections": null
},
"state_key": "test_dateandtimetypes_307398"
}

10 changes: 0 additions & 10 deletions source-postgres-batch/.snapshots/TestDecimals

This file was deleted.

11 changes: 0 additions & 11 deletions source-postgres-batch/.snapshots/TestFloatNaNs-Capture

This file was deleted.

Loading
Loading