No more Tuple, List, Dict (#38797)
* No more Tuple, List, Dict * make fixup * More style fixes * Docstring fixes with regex replacement * Trigger tests * Redo fixes after rebase * Fix copies * [test all] * update * [test all] * update * [test all] * make style after rebase * Patch the hf_argparser test * Patch the hf_argparser test * style fixes * style fixes * style fixes * Fix docstrings in Cohere test * [test all] --------- Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
@@ -16,7 +16,6 @@ import json
|
||||
import os
|
||||
import re
|
||||
import time
|
||||
from typing import Dict, List
|
||||
|
||||
from get_ci_error_statistics import get_jobs
|
||||
from slack_sdk import WebClient
|
||||
@@ -60,7 +59,7 @@ def extract_first_line_failure(failures_short_lines):
|
||||
|
||||
|
||||
class Message:
|
||||
def __init__(self, title: str, doc_test_results: Dict):
|
||||
def __init__(self, title: str, doc_test_results: dict):
|
||||
self.title = title
|
||||
|
||||
self.n_success = sum(job_result["n_success"] for job_result in doc_test_results.values())
|
||||
@@ -90,11 +89,11 @@ class Message:
|
||||
return f"{int(hours)}h{int(minutes)}m{int(seconds)}s"
|
||||
|
||||
@property
|
||||
def header(self) -> Dict:
|
||||
def header(self) -> dict:
|
||||
return {"type": "header", "text": {"type": "plain_text", "text": self.title}}
|
||||
|
||||
@property
|
||||
def no_failures(self) -> Dict:
|
||||
def no_failures(self) -> dict:
|
||||
return {
|
||||
"type": "section",
|
||||
"text": {
|
||||
@@ -110,7 +109,7 @@ class Message:
|
||||
}
|
||||
|
||||
@property
|
||||
def failures(self) -> Dict:
|
||||
def failures(self) -> dict:
|
||||
return {
|
||||
"type": "section",
|
||||
"text": {
|
||||
@@ -129,7 +128,7 @@ class Message:
|
||||
}
|
||||
|
||||
@property
|
||||
def category_failures(self) -> List[Dict]:
|
||||
def category_failures(self) -> list[dict]:
|
||||
failure_blocks = []
|
||||
|
||||
MAX_ERROR_TEXT = 3000 - len("The following examples had failures:\n\n\n\n") - len("[Truncated]\n")
|
||||
@@ -301,7 +300,7 @@ def retrieve_available_artifacts():
|
||||
def add_path(self, path: str):
|
||||
self.paths.append({"name": self.name, "path": path})
|
||||
|
||||
_available_artifacts: Dict[str, Artifact] = {}
|
||||
_available_artifacts: dict[str, Artifact] = {}
|
||||
|
||||
directories = filter(os.path.isdir, os.listdir())
|
||||
for directory in directories:
|
||||
|
||||
Reference in New Issue
Block a user