MINOR: Removed supportsDDL from json schemas (#16171)

This commit is contained in:
Suman Maharana 2024-05-10 17:40:12 +05:30 committed by GitHub
parent 3db9dadaa6
commit 0e2736ee74
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
17 changed files with 17 additions and 52 deletions

View File

@ -630,7 +630,9 @@ class BigquerySource(
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:

View File

@ -161,7 +161,9 @@ class ClickhouseSource(CommonDbSourceService):
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

View File

@ -366,16 +366,19 @@ class CommonDbSourceService(
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

View File

@ -108,7 +108,9 @@ class HiveSource(CommonDbSourceService):
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

View File

@ -163,7 +163,9 @@ class OracleSource(StoredProcedureMixin, CommonDbSourceService):
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

View File

@ -82,7 +82,6 @@ EXPECTED_SERVICE = [
connectionArguments=None,
supportsMetadataExtraction=True,
supportsProfiler=True,
supportsDDL=True,
supportsDBTExtraction=True,
)
),

View File

@ -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",

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"