FIX - e2e test for pydantic v2 (#16572)

This commit is contained in:
Pere Miquel Brull 2024-06-07 22:52:16 +02:00 committed by GitHub
parent c86468d992
commit f5996b2f3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 7 deletions

View File

@ -66,11 +66,10 @@ class CliBase(ABC):
def build_config_file(
self, test_type: E2EType = E2EType.INGEST, extra_args: dict = None
) -> None:
with open(self.config_file_path, encoding=UTF_8) as config_file:
config_yaml = yaml.safe_load(config_file)
config_yaml = self.build_yaml(config_yaml, test_type, extra_args)
with open(self.test_file_path, "w", encoding=UTF_8) as test_file:
yaml.dump(config_yaml, test_file)
config_yaml = load_config_file(Path(self.config_file_path))
config_yaml = self.build_yaml(config_yaml, test_type, extra_args)
with open(self.test_file_path, "w", encoding=UTF_8) as test_file:
yaml.dump(config_yaml, test_file)
def retrieve_statuses(self, result):
source_status: Status = self.extract_source_status(result)

View File

@ -11,9 +11,11 @@
"type": "string"
},
"publisherType": {
"description": "Publisher Type",
"$ref": "../system/eventPublisherJob.json#/definitions/publisherType"
},
"runMode": {
"description": "This schema publisher run modes.",
"$ref": "../system/eventPublisherJob.json#/definitions/runMode"
},
"entities": {

View File

@ -7,6 +7,7 @@
"javaType": "org.openmetadata.schema.api.VoteRequest",
"properties": {
"updatedVoteType": {
"description": "The updated vote type",
"$ref": "../type/votes.json#/definitions/voteType"
}
},

View File

@ -38,7 +38,7 @@ UNICODE_REGEX_REPLACEMENT_FILE_PATHS = [
f"{ingestion_path}src/metadata/generated/schema/type/basic.py",
]
args = f"--custom-template-dir {directory_root}/ingestion/codegen_custom_templates --input {directory_root}openmetadata-spec/src/main/resources/json/schema --output-model-type pydantic_v2.BaseModel --use-annotated --base-class metadata.ingestion.models.custom_pydantic.BaseModel --input-file-type jsonschema --output {ingestion_path}src/metadata/generated/schema --set-default-enum-member".split(" ")
args = f"--input {directory_root}openmetadata-spec/src/main/resources/json/schema --output-model-type pydantic_v2.BaseModel --use-annotated --base-class metadata.ingestion.models.custom_pydantic.BaseModel --input-file-type jsonschema --output {ingestion_path}src/metadata/generated/schema --set-default-enum-member".split(" ")
main(args)
@ -85,7 +85,6 @@ for file_path in UNSUPPORTED_REGEX_PATTERN_FILE_PATHS:
# Supporting timezone aware datetime is too complex for the profiler
DATETIME_AWARE_FILE_PATHS = [
f"{ingestion_path}src/metadata/generated/schema/type/basic.py",
# f"{ingestion_path}src/metadata/generated/schema/entity/data/table.py",
]
for file_path in DATETIME_AWARE_FILE_PATHS: