# 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)]
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'])})"
)
),
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'])})"
)
),