Fix #1808: check for None in description (#1809)

This commit is contained in:
Sriharsha Chintalapani 2021-12-16 12:15:42 -08:00 committed by GitHub
parent d71c75aaa1
commit df6232ef52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 8 deletions

View File

@ -5,9 +5,9 @@
"username": "openmetadata_user",
"password": "openmetadata_password",
"database": "openmetadata_db",
"service_name": "local_mysql",
"filter_pattern": {
"excludes": ["mysql.*", "information_schema.*", "performance_schema.*", "sys.*"]
"service_name": "local_mariadb",
"schema_filter_pattern": {
"excludes": ["information_schema.*", "performance_schema.*", "sys.*"]
}
}
},

View File

@ -2,14 +2,14 @@
"source": {
"type": "redshift",
"config": {
"host_port": "cluster.name.region.redshift.amazonaws.com:5439",
"host_port": "cluster.name.region.redshift.amazonaws.com:5439",
"username": "username",
"password": "strong_password",
"database": "warehouse",
"service_name": "aws_redshift",
"generate_sample_data": "false",
"filter_pattern": {
"excludes": ["information_schema.*", "[\\w]*event_vw.*"]
"schema_filter_pattern": {
"excludes": ["information_schema.*"]
},
"dbt_manifest_file": "./examples/sample_data/dbt/manifest.json",
"dbt_catalog_file": "./examples/sample_data/dbt/catalog.json"

View File

@ -145,11 +145,14 @@ class MetadataRestSink(Sink[Entity]):
),
)
db = self.metadata.create_or_update(db_request)
if db_and_table.table.description is not None:
db_and_table.table.description = db_and_table.table.description.strip()
table_request = CreateTableEntityRequest(
name=db_and_table.table.name,
tableType=db_and_table.table.tableType,
columns=db_and_table.table.columns,
description=db_and_table.table.description.strip(),
description=db_and_table.table.description,
database=db.id,
)
if db_and_table.table.viewDefinition:
@ -159,9 +162,13 @@ class MetadataRestSink(Sink[Entity]):
created_table = self.metadata.create_or_update(table_request)
if db_and_table.location is not None:
if db_and_table.location.description is not None:
db_and_table.location.description = (
db_and_table.location.description.strip()
)
location_request = CreateLocationEntityRequest(
name=db_and_table.location.name,
description=db_and_table.location.description.strip(),
description=db_and_table.location.description,
locationType=db_and_table.location.locationType,
owner=db_and_table.location.owner,
service=EntityReference(