Fix#7532: Allow overriding service connection config when ingesting from CLI (#8091)

* Allow overriding service connection config when ingesting from CLI

* Rename field in JSON schema

* Address comment
This commit is contained in:
Nahuel 2022-10-13 12:34:03 +02:00 committed by GitHub
parent 56d555eb58
commit 48905a7f6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

View File

@ -198,7 +198,7 @@ class TopologyRunnerMixin(Generic[C]):
)
# we get entity from OM if we do not want to overwrite existing data in OM
if not stage.overwrite:
if not stage.overwrite and not self._is_force_overwrite_enabled():
entity = self.metadata.get_by_name(
entity=stage.type_,
fqn=entity_fqn,
@ -234,3 +234,6 @@ class TopologyRunnerMixin(Generic[C]):
if stage.context and stage.cache_all:
self.append_context(key=stage.context, value=entity)
logger.debug(self.context)
def _is_force_overwrite_enabled(self) -> bool:
return self.metadata.config and self.metadata.config.forceEntityOverwriting

View File

@ -158,6 +158,7 @@ class OpenMetadata(
client: REST
_auth_provider: AuthenticationProvider
config: OpenMetadataConnection
class_root = ".".join(["metadata", "generated", "schema"])
entity_path = "entity"

View File

@ -176,6 +176,11 @@
"type": "integer",
"default": "1000"
},
"forceEntityOverwriting": {
"description": "Force the overwriting of any entity during the ingestion.",
"type": "boolean",
"default": false
},
"supportsMetadataExtraction": {
"$ref": "../connectionBasicType.json#/definitions/supportsMetadataExtraction"
}