diff --git a/datacontract/data_contract.py b/datacontract/data_contract.py index 806810db..d1952134 100644 --- a/datacontract/data_contract.py +++ b/datacontract/data_contract.py @@ -228,12 +228,12 @@ def test(self) -> Run: try: publish_datamesh_manager(run, self._publish_url) except Exception: - logging.error("Failed to publish to datamesh manager") + run.log_error("Failed to publish to datamesh manager") if self._publish_to_opentelemetry: try: publish_opentelemetry(run) except Exception: - logging.error("Failed to publish to opentelemetry") + run.log_error("Failed to publish to opentelemetry") return run @@ -425,7 +425,7 @@ def export(self, export_format, model: str = "all", rdf_base: str = None, sql_se print(f"Export format {export_format} not supported.") return "" - def _determine_sql_server_type(data_contract, sql_server_type): + def _determine_sql_server_type(self, data_contract: DataContractSpecification, sql_server_type: str): if sql_server_type == "auto": if data_contract.servers is None or len(data_contract.servers) == 0: raise RuntimeError("Export with server_type='auto' requires servers in the data contract.") diff --git a/datacontract/integration/publish_datamesh_manager.py b/datacontract/integration/publish_datamesh_manager.py index 84d8caa1..485064db 100644 --- a/datacontract/integration/publish_datamesh_manager.py +++ b/datacontract/integration/publish_datamesh_manager.py @@ -1,4 +1,3 @@ -import logging import os import requests @@ -29,6 +28,6 @@ def publish_datamesh_manager(run: Run, publish_url: str): if response.status_code != 200: run.log_error(f"Error publishing test results to Data Mesh Manager: {response.text}") return - logging.info("Published test results to %s", url) + run.log_info(f"Published test results to {url}") except Exception as e: - logging.error(f"Failed publishing test results. Error: {str(e)}") + run.log_error(f"Failed publishing test results. Error: {str(e)}") diff --git a/tests/test_examples_kafka.py b/tests/test_examples_kafka.py index 98163121..7e588cf7 100644 --- a/tests/test_examples_kafka.py +++ b/tests/test_examples_kafka.py @@ -32,6 +32,7 @@ def remove_container(): request.addfinalizer(remove_container) +@pytest.mark.skipif(sys.platform == 'darwin', reason="Fails on ARM mac, https://github.com/testcontainers/testcontainers-python/issues/450") def test_examples_kafka(kafka_container: KafkaContainer): send_messages_to_topic("examples/kafka/data/messages.json", "inventory-events") data_contract_str = _setup_datacontract()