Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PERF-259] Improve error handling when metadata disabled #88

Merged
merged 3 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/edfi-paging-test/edfi_paging_test/helpers/api_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def get_base_api_response(api_base_url: str, verify_cert: bool = True) -> Dict[s
api_base_url,
verify=verify_cert
).json()
except Exception as e:
raise RuntimeError(f"Error fetching: {api_base_url}") from e
except requests.exceptions.RequestException as e:
raise RuntimeError(f"Error: {e}.") from e


@cache
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def fetch_resource(request_client: RequestClient, target_resource: str) -> None:
def invalid_resources(
openapi_resources: List[str], resources_to_check: List[str]
) -> List[str]:
return [r for r in resources_to_check if r.lower() not in openapi_resources]
return [r for r in resources_to_check if r not in openapi_resources]


async def run(args: MainArguments) -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/edfi-paging-test/edfi_paging_test/reporter/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def _calculate_statistics(df: DataFrame) -> DataFrame:
"MeanTime": s["MeanTime"].mean(),
# "Unbiased" estimate of standard deviation for a sample
# (ddof=1, panda's default). Equivalent of Excel STDEV.S()
"StDeviation": s["StDeviation"].std().round(6),
"StDeviation": s["StDeviation"].std().round(6), # type: ignore
"NumberOfErrors": s[(s["StatusCode"] >= 400)]["StatusCode"].count(),
}
)
Expand Down
6 changes: 3 additions & 3 deletions src/edfi-paging-test/edfi_paging_test/reporter/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ class Summary:
machine_name : str = socket.gethostname()

def __post_init__(self):
if(self.run_configration):
if (self.run_configration):
self.run_configration.resourceList = (self.run_configration.resourceList or ["all"])
self.run_configration.contentType = self.run_configration.contentType.value
self.run_configration.log_level = self.run_configration.log_level.value
self.run_configration.contentType = self.run_configration.contentType.value # type: ignore
self.run_configration.log_level = self.run_configration.log_level.value # type: ignore

def get_DataFrame(self) -> DataFrame:
"""
Expand Down
Loading