Skip to content

Commit

Permalink
MINOR: Removed supportsDDL from json schemas (open-metadata#16171)
Browse files Browse the repository at this point in the history
  • Loading branch information
SumanMaharana authored May 10, 2024
1 parent 3db9dad commit 0e2736e
Show file tree
Hide file tree
Showing 17 changed files with 17 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,9 @@ def get_schema_definition(
self.connection, table_name, schema_name
)
schema_definition = (
str(schema_definition) if schema_definition is not None else None
str(schema_definition.strip())
if schema_definition is not None
else None
)
return schema_definition
except NotImplementedError:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ def get_schema_definition(
self.connection, table_name, schema_name
)
schema_definition = (
str(schema_definition) if schema_definition is not None else None
str(schema_definition.strip())
if schema_definition is not None
else None
)
return schema_definition

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,16 +366,19 @@ def get_schema_definition(
Get the DDL statement or View Definition for a table
"""
try:
schema_definition = None
if table_type in (TableType.View, TableType.MaterializedView):
schema_definition = inspector.get_view_definition(
table_name, schema_name
)
else:
elif hasattr(inspector, "get_table_ddl"):
schema_definition = inspector.get_table_ddl(
self.connection, table_name, schema_name
)
schema_definition = (
str(schema_definition) if schema_definition is not None else None
str(schema_definition).strip()
if schema_definition is not None
else None
)
return schema_definition

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ def get_schema_definition( # pylint: disable=unused-argument
try:
schema_definition = inspector.get_view_definition(table_name, schema_name)
schema_definition = (
str(schema_definition) if schema_definition is not None else None
str(schema_definition).strip()
if schema_definition is not None
else None
)
return schema_definition

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ def get_schema_definition(
schema_definition = definition_fn(table_name, schema_name)

schema_definition = (
str(schema_definition) if schema_definition is not None else None
str(schema_definition.strip())
if schema_definition is not None
else None
)
return schema_definition

Expand Down
1 change: 0 additions & 1 deletion ingestion/tests/unit/topology/metadata/test_amundsen.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
connectionArguments=None,
supportsMetadataExtraction=True,
supportsProfiler=True,
supportsDDL=True,
supportsDBTExtraction=True,
)
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@
"type": "boolean",
"default": true
},
"supportsDDL": {
"description": "Supports DDL",
"type": "boolean",
"default": true
},
"supportsDatabase": {
"description": "The source service supports the database concept in its hierarchy",
"type": "boolean",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@
"title": "Supports Profiler",
"$ref": "../connectionBasicType.json#/definitions/supportsProfiler"
},
"supportsDDL": {
"title": "Supports DDL",
"$ref": "../connectionBasicType.json#/definitions/supportsDDL"
},
"supportsDatabase": {
"title": "Supports Database",
"$ref": "../connectionBasicType.json#/definitions/supportsDatabase"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,6 @@
"title": "Supports Profiler",
"$ref": "../connectionBasicType.json#/definitions/supportsProfiler"
},
"supportsDDL": {
"title": "Supports DDL",
"$ref": "../connectionBasicType.json#/definitions/supportsDDL"
},
"supportsQueryComment": {
"title": "Supports Query Comment",
"$ref": "../connectionBasicType.json#/definitions/supportsQueryComment"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@
"title": "Supports Profiler",
"$ref": "../connectionBasicType.json#/definitions/supportsProfiler"
},
"supportsDDL": {
"title": "Supports DDL",
"$ref": "../connectionBasicType.json#/definitions/supportsDDL"
},
"supportsDatabase": {
"title": "Supports Database",
"$ref": "../connectionBasicType.json#/definitions/supportsDatabase"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,6 @@
"title": "Supports Profiler",
"$ref": "../connectionBasicType.json#/definitions/supportsProfiler"
},
"supportsDDL": {
"title": "Supports DDL",
"$ref": "../connectionBasicType.json#/definitions/supportsDDL"
},
"sampleDataStorageConfig": {
"title": "Storage Config for Sample Data",
"$ref": "../connectionBasicType.json#/definitions/sampleDataStorageConfig"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@
"title": "Supports Profiler",
"$ref": "../connectionBasicType.json#/definitions/supportsProfiler"
},
"supportsDDL": {
"title": "Supports DDL",
"$ref": "../connectionBasicType.json#/definitions/supportsDDL"
},
"supportsDatabase": {
"title": "Supports Database",
"$ref": "../connectionBasicType.json#/definitions/supportsDatabase"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@
"title": "Supports Query Comment",
"$ref": "../connectionBasicType.json#/definitions/supportsQueryComment"
},
"supportsDDL": {
"title": "Supports DDL",
"$ref": "../connectionBasicType.json#/definitions/supportsDDL"
},
"sampleDataStorageConfig": {
"title": "Storage Config for Sample Data",
"$ref": "../connectionBasicType.json#/definitions/sampleDataStorageConfig"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,6 @@
"title": "Supports Profiler",
"$ref": "../connectionBasicType.json#/definitions/supportsProfiler"
},
"supportsDDL": {
"title": "Supports DDL",
"$ref": "../connectionBasicType.json#/definitions/supportsDDL"
},
"supportsQueryComment": {
"title": "Supports Query Comment",
"$ref": "../connectionBasicType.json#/definitions/supportsQueryComment"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,6 @@
"title": "Supports Profiler",
"$ref": "../connectionBasicType.json#/definitions/supportsProfiler"
},
"supportsDDL": {
"title": "Supports DDL",
"$ref": "../connectionBasicType.json#/definitions/supportsDDL"
},
"supportsDatabase": {
"title": "Supports Database",
"$ref": "../connectionBasicType.json#/definitions/supportsDatabase"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@
"title": "Supports Profiler",
"$ref": "../connectionBasicType.json#/definitions/supportsProfiler"
},
"supportsDDL": {
"title": "Supports DDL",
"$ref": "../connectionBasicType.json#/definitions/supportsDDL"
},
"supportsDatabase": {
"title": "Supports Database",
"$ref": "../connectionBasicType.json#/definitions/supportsDatabase"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,6 @@
"title": "Supports Profiler",
"$ref": "../connectionBasicType.json#/definitions/supportsProfiler"
},
"supportsDDL": {
"title": "Supports DDL",
"$ref": "../connectionBasicType.json#/definitions/supportsDDL"
},
"supportsDatabase": {
"title": "Supports Database",
"$ref": "../connectionBasicType.json#/definitions/supportsDatabase"
Expand Down

0 comments on commit 0e2736e

Please sign in to comment.