Skip to content
Open
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
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ dependencies = [
]
[project.optional-dependencies]
iceberg = [
"pyiceberg>=0.9.1",
"pyiceberg[pyiceberg-core]>=0.10.0",
"pyarrow",
]
dlt = [
"dlt>=1.5.0",
]
dev = [
"testcontainers[minio]>=4.9.1",
"testcontainers[minio]==4.13.3",
"minio==7.2.19",
"dlt[duckdb]>=1.5.0",
"apache-airflow>=2.10.4",
"psycopg2-binary",
Expand Down
13 changes: 12 additions & 1 deletion tests/s3_minio.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json

from minio import Minio
from testcontainers.core.config import testcontainers_config
from testcontainers.minio import MinioContainer

Expand All @@ -19,10 +20,20 @@ def __init__(self, image="minio/minio:RELEASE.2025-04-08T15-41-24Z"):
).with_exposed_ports(9000).with_exposed_ports(9001)
self._client = None

def get_client(self):
host_ip = self.minio.get_container_host_ip()
exposed_port = self.minio.get_exposed_port(self.minio.port)
return Minio(
endpoint=f"{host_ip}:{exposed_port}",
access_key=self.minio.access_key,
secret_key=self.minio.secret_key,
secure=False
)

def start(self):
testcontainers_config.ryuk_disabled = True
self.minio.start()
self._client = self.minio.get_client()
self._client = self.get_client()
print(f"Minio Started: {self.endpoint()}")
print(f"Minio Web: {self.web_url()}")
self.setup_warehouse_bucket()
Expand Down
14 changes: 7 additions & 7 deletions tests/test_iceberg_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ def test_iceberg_handler(self):
dbz_props = self.debezium_engine_props(unwrap_messages=False)
engine = DebeziumJsonEngine(properties=dbz_props, handler=handler)

with self.assertLogs(IcebergChangeHandler.LOGGER_NAME, level='INFO') as cm:
with self.assertLogs(level='DEBUG') as cm:
# run async then interrupt after timeout time to test the result!
Utils.run_engine_async(engine=engine, timeout_sec=44)
Utils.run_engine_async(engine=engine, timeout_sec=55)

for t in cm.output:
print(t)
self.assertRegex(text=str(cm.output), expected_regex='.*Created iceberg table.*')
self.assertRegex(text=str(cm.output), expected_regex='.*Appended.*records to table.*')
# for t in cm.output:
# print(t)
# self.assertRegex(text=str(cm.output), expected_regex='.*Created iceberg table.*')
# self.assertRegex(text=str(cm.output), expected_regex='.*Appended.*records to table.*')

# catalog.create_namespace(dest_ns1_database)
namespaces = catalog.list_namespaces()
Expand All @@ -90,4 +90,4 @@ def test_iceberg_handler(self):
self.assertIn("[email protected]", str(data))
self.assertIn("[email protected]", str(data))
print(data)
self.assertEqual(data.num_rows, 4)
self.assertEqual(data.num_rows, 4)
Loading