diff --git a/ingestion/src/metadata/ingestion/source/dynamodb.py b/ingestion/src/metadata/ingestion/source/dynamodb.py index 0b87aa4378c..826d1034e30 100644 --- a/ingestion/src/metadata/ingestion/source/dynamodb.py +++ b/ingestion/src/metadata/ingestion/source/dynamodb.py @@ -19,7 +19,7 @@ from metadata.ingestion.api.common import Entity from metadata.ingestion.api.source import InvalidSourceException, Source, SourceStatus from metadata.ingestion.models.ometa_table_db import OMetaDatabaseAndTable from metadata.ingestion.ometa.ometa_api import OpenMetadata -from metadata.ingestion.source.sql_source_common import SQLSourceStatus +from metadata.ingestion.source.sql_source import SQLSourceStatus from metadata.utils.aws_client import AWSClient from metadata.utils.column_type_parser import ColumnTypeParser from metadata.utils.filters import filter_by_table @@ -27,8 +27,6 @@ from metadata.utils.helpers import get_database_service_or_create logger: logging.Logger = logging.getLogger(__name__) -from metadata.generated.schema.entity.data.databaseSchema import DatabaseSchema - class DynamodbSource(Source[Entity]): def __init__(self, config, metadata_config: OpenMetadataServerConfig): diff --git a/ingestion/tests/unit/source/test_dynamodb.py b/ingestion/tests/unit/source/test_dynamodb.py index dd731a887e1..ea737e5ed89 100644 --- a/ingestion/tests/unit/source/test_dynamodb.py +++ b/ingestion/tests/unit/source/test_dynamodb.py @@ -10,7 +10,7 @@ # limitations under the License. """ -Query parser utils tests +Dynamodb unit test """ import json from unittest import TestCase @@ -24,35 +24,40 @@ from metadata.ingestion.models.ometa_table_db import OMetaDatabaseAndTable CONFIG = """ { - "source": { - "type": "dynamodb", + "source": { + "type": "dynamodb", + "serviceName": "local_dynamodb", + "serviceConnection": { "config": { - "aws_access_key_id": "aws_access_key_id", - "aws_secret_access_key": "aws_secret_access_key", - "service_name": "DynamoDBTest", - "region_name": "us-east-2", - "endpoint_url": "https://dynamodb.us-east-2.amazonaws.com", - "db_name":"custom_database_name", - "table_filter_pattern":{ - "excludes": ["Music.*"] + "awsAccessKeyId": "aws_access_key_id", + "awsSecretAccessKey": "aws_secret_access_key", + "awsRegion": "us-east-2", + "endPointURL": "https://dynamodb.us-east-2.amazonaws.com", + "database": "custom_database_name" + } + }, + "sourceConfig": { + "config": { + "enableDataProfiler": false, + "tableFilterPattern": { + "includes": [""] } } - }, - "sink": { - "type": "file", - "config": { - "filename": "./datasets.json" - } - }, - "metadata_server": { - "type": "metadata-server", - "config": { - "api_endpoint": "http://localhost:8585/api", - "auth_provider_type": "no-auth" - } + } + }, + "sink": { + "type": "file", + "config": { + "filename": "/var/tmp/datasets.json" + } + }, + "workflowConfig": { + "openMetadataServerConfig": { + "hostPort": "http://localhost:8585/api", + "authProvider": "no-auth" } } - +} """