Skip to content

Commit

Permalink
DynamoDB CDC: Make MODIFY operation also propagate deleted attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Sep 25, 2024
1 parent 482378f commit 331c0ba
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

## Unreleased
- MongoDB: Configure `MongoDBCrateDBConverter` after updating to commons-codec 0.0.18
- DynamoDB CDC: Fix `MODIFY` operation to also propagate deleted attributes

## 2024/09/22 v0.0.25
- Table Loader: Improved conditional handling of "transformation" parameter
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ docs = [
]
dynamodb = [
"boto3",
"commons-codec>=0.0.14",
"commons-codec>=0.0.19",
]
full = [
"cratedb-toolkit[cfr,cloud,datasets,io,service]",
Expand All @@ -163,11 +163,11 @@ io = [
kinesis = [
"aiobotocore<2.16",
"async-kinesis<1.2",
"commons-codec>=0.0.14",
"commons-codec>=0.0.19",
"lorrystream[carabas]>=0.0.6",
]
mongodb = [
"commons-codec[mongodb,zyp]>=0.0.18",
"commons-codec[mongodb,zyp]>=0.0.19",
"cratedb-toolkit[io]",
"orjson<4,>=3.3.1",
"pymongo<4.9,>=3.10.1",
Expand Down
2 changes: 2 additions & 0 deletions tests/io/dynamodb/test_relay.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def test_kinesis_earliest_dynamodb_cdc_insert_update(caplog, cratedb, dynamodb):
assert cratedb.database.count_records(table_name) == 1
results = cratedb.database.run_sql(f"SELECT * FROM {table_name}", records=True) # noqa: S608
assert results[0]["data"]["list_of_objects"] == [{"foo": "bar"}, {"baz": "qux"}]
assert "tombstone" not in results[0]["data"]


def test_kinesis_latest_dynamodb_cdc_insert_update(caplog, cratedb, dynamodb):
Expand Down Expand Up @@ -104,3 +105,4 @@ def test_kinesis_latest_dynamodb_cdc_insert_update(caplog, cratedb, dynamodb):
assert cratedb.database.count_records(table_name) == 1
results = cratedb.database.run_sql(f"SELECT * FROM {table_name}", records=True) # noqa: S608
assert results[0]["data"]["list_of_objects"] == [{"foo": "bar"}, {"baz": "qux"}]
assert "tombstone" not in results[0]["data"]
2 changes: 2 additions & 0 deletions tests/io/test_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
"test2": {"N": 2},
}
},
# An item that should be removed by the subsequent MODIFY operation.
"tombstone": {"S": "foo"},
},
"SizeBytes": 156,
"ApproximateCreationDateTimePrecision": "MICROSECOND",
Expand Down

0 comments on commit 331c0ba

Please sign in to comment.