Imri Paran 0fee79b200
MINOR: fix sample data issue with Pydantic v2 and refactor python integration tests (#16943)
* tests: refactor

refactor tests and consolidate common functionality in integrations.conftest

this enables writing tests more concisely.
demonstrated with postgres and mssql.
will migrate more

* format

* removed helpers

* changed scope of fictures

* changed scope of fixtures

* added profiler test for mssql

* fixed import in data_quality test

* json safe serialization

* format

* set MARS_Connection

* use SerializableTableData instead of TableData

* deleted file test_postgres.py

* fixed tests

* added more test cases

* format

* changed name test_models.py

* removed the logic for serializing table data

* wip

* changed mapping in common type map

* changed mapping in common type map

* reverted TableData imports

* reverted TableData imports

* reverted TableData imports
2024-07-17 08:11:34 +02:00

20 lines
635 B
Python

from metadata.generated.schema.entity.data.table import Table
from metadata.ingestion.ometa.ometa_api import OpenMetadata
from metadata.workflow.metadata import MetadataWorkflow
def test_metadata(
db_service, metadata: OpenMetadata, run_workflow, ingestion_config, create_test_data
):
run_workflow(MetadataWorkflow, ingestion_config)
tables = metadata.list_entities(
Table,
params={
"databaseSchema": f"{db_service.fullyQualifiedName.root}.minio.my_schema"
},
)
assert (
next((t for t in tables.entities if t.name.root == "test_table"), None)
is not None
)