X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Ftools%2Fdash%2Fapp%2Fpal%2Fnews%2Ftables.py;h=1a6c7d2556da68f5667224d7c7e3c1ec8e83eaf5;hp=53b24608d51a0af1985af4195611c0d1ea88769b;hb=2f9e211bd097fdd2f83df540aa494d924df01c7d;hpb=371bac71bc789bf9d68fa1b8ba77f21c4876244f diff --git a/resources/tools/dash/app/pal/news/tables.py b/resources/tools/dash/app/pal/news/tables.py index 53b24608d5..1a6c7d2556 100644 --- a/resources/tools/dash/app/pal/news/tables.py +++ b/resources/tools/dash/app/pal/news/tables.py @@ -11,19 +11,26 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" +"""The tables with news. """ import pandas as pd import dash_bootstrap_components as dbc - -# Time period for regressions and progressions. -TIME_PERIOD = 21 # [days] +from ..utils.constants import Constants as C def table_news(data: pd.DataFrame, job: str) -> list: - """ + """Generates the tables with news: + 1. Falied tests from the last run + 2. Regressions and progressions calculated from the last C.NEWS_TIME_PERIOD + days. + + :param data: Trending data with calculated annomalies to be displayed in the + tables. + :param job: The job name. + :type data: pandas.DataFrame + :type job: str """ job_data = data.loc[(data["job"] == job)] @@ -57,7 +64,7 @@ def table_news(data: pd.DataFrame, job: str) -> list: class_name="p-0", size="lg", children=( - f"Regressions during the last {TIME_PERIOD} days " + f"Regressions during the last {C.NEWS_TIME_PERIOD} days " f"({len(regressions['Test Name'])})" ) ), @@ -68,7 +75,7 @@ def table_news(data: pd.DataFrame, job: str) -> list: class_name="p-0", size="lg", children=( - f"Progressions during the last {TIME_PERIOD} days " + f"Progressions during the last {C.NEWS_TIME_PERIOD} days " f"({len(progressions['Test Name'])})" ) ),