Fix e2e profiler status (#13127)

This commit is contained in:
Pere Miquel Brull 2023-09-10 18:46:28 +02:00 committed by GitHub
parent e98cb244a4
commit 66a89ffe61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 10 deletions

View File

@ -87,3 +87,7 @@ class ProfilerResponse(ConfigModel):
profile: CreateTableProfileRequest profile: CreateTableProfileRequest
sample_data: Optional[TableData] = None sample_data: Optional[TableData] = None
column_tags: Optional[List[PatchColumnTagResponse]] = None column_tags: Optional[List[PatchColumnTagResponse]] = None
def __str__(self):
"""Return the table name being processed"""
return f"Table [{self.table.name.__root__}]"

View File

@ -52,6 +52,10 @@ class ProfilerSourceAndEntity(BaseModel):
profiler_source: ProfilerSource profiler_source: ProfilerSource
entity: Table entity: Table
def __str__(self):
"""Return the information of the table being profiler"""
return f"Table [{self.entity.name.__root__}]"
class OpenMetadataSource(Source): class OpenMetadataSource(Source):
""" """

View File

@ -91,9 +91,9 @@ class CliBase(ABC):
output_clean = re.sub(" +", " ", output_clean) output_clean = re.sub(" +", " ", output_clean)
output_clean_ansi = re.compile(r"\x1b[^m]*m") output_clean_ansi = re.compile(r"\x1b[^m]*m")
output_clean = output_clean_ansi.sub(" ", output_clean) output_clean = output_clean_ansi.sub(" ", output_clean)
regex = r"Source Status:%(log)s(.*?)%(log)sSink Status: .*" % REGEX_AUX regex = r"Source Status:%(log)s(.*?)%(log)s.* Status: .*" % REGEX_AUX
output_clean = re.findall(regex, output_clean.strip()) output_clean_regex = re.findall(regex, output_clean.strip())
return Status.parse_obj(literal_eval(output_clean[0].strip())) return Status.parse_obj(literal_eval(output_clean_regex[0].strip()))
@staticmethod @staticmethod
def extract_sink_status(output) -> Status: def extract_sink_status(output) -> Status:
@ -101,13 +101,9 @@ class CliBase(ABC):
output_clean = re.sub(" +", " ", output_clean) output_clean = re.sub(" +", " ", output_clean)
output_clean_ansi = re.compile(r"\x1b[^m]*m") output_clean_ansi = re.compile(r"\x1b[^m]*m")
output_clean = output_clean_ansi.sub("", output_clean) output_clean = output_clean_ansi.sub("", output_clean)
if re.match(".* Processor Status: .*", output_clean): regex = r".*Sink Status:%(log)s(.*?)%(log)sWorkflow.*Summary.*" % REGEX_AUX
regex = r"Sink Status:%(log)s(.*?)%(log)sProcessor Status: .*" % REGEX_AUX output_clean_regex = re.findall(regex, output_clean.strip())[0].strip()
output_clean = re.findall(regex, output_clean.strip())[0].strip() return Status.parse_obj(literal_eval(output_clean_regex))
else:
regex = r".*Sink Status:%(log)s(.*?)%(log)sWorkflow.*Summary.*" % REGEX_AUX
output_clean = re.findall(regex, output_clean.strip())[0].strip()
return Status.parse_obj(literal_eval(output_clean))
@staticmethod @staticmethod
def build_yaml(config_yaml: dict, test_type: E2EType, extra_args: dict): def build_yaml(config_yaml: dict, test_type: E2EType, extra_args: dict):