diff options
author | Tibor Frank <tifrank@cisco.com> | 2023-10-10 08:14:18 +0000 |
---|---|---|
committer | Tibor Frank <tifrank@cisco.com> | 2023-10-11 07:38:18 +0000 |
commit | 86ec9713ecde3d92ec4585d487ddfac5077428c8 (patch) | |
tree | 2918a347f80ccf9d628f9132d7d1a454043fb9ae /csit.infra.dash/app/cdash/data/data.py | |
parent | c3ce59c652caaee06b3090f387f8826c15102703 (diff) |
C-Dash: Add bandwidth to trending graphs
- NDRPDR tests only
- MRR to be done when data is in parquets
Change-Id: If2b1f76d5e2dc6f3a480eeb0950e7ab9550f8901
Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'csit.infra.dash/app/cdash/data/data.py')
-rw-r--r-- | csit.infra.dash/app/cdash/data/data.py | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/csit.infra.dash/app/cdash/data/data.py b/csit.infra.dash/app/cdash/data/data.py index 2bf3649778..783ebe25ff 100644 --- a/csit.infra.dash/app/cdash/data/data.py +++ b/csit.infra.dash/app/cdash/data/data.py @@ -30,6 +30,12 @@ from pyarrow.lib import ArrowInvalid, ArrowNotImplementedError from ..utils.constants import Constants as C +# If True, pyarrow.Schema is generated. See also condition in the method +# _write_parquet_schema. +# To generate schema, select only one data set in data.yaml file. +GENERATE_SCHEMA = False + + class Data: """Gets the data from parquets and stores it for further use by dash applications. @@ -212,7 +218,10 @@ class Data: for itm in df: try: # Specify the condition or remove it: - if pd.api.types.is_string_dtype(itm["result_rate_unit"]): + if all(( + pd.api.types.is_string_dtype(itm["<column_name>"]), + pd.api.types.is_string_dtype(itm["telemetry"][0]) + )): print(pa.Schema.from_pandas(itm)) pa.parquet.write_metadata( pa.Schema.from_pandas(itm), @@ -357,6 +366,18 @@ class Data: time_period = days else: time_period = None + + if GENERATE_SCHEMA: + # Generate schema: + Data._write_parquet_schema( + path=data_set["path"], + partition_filter=partition_filter, + columns=data_set.get("columns", None), + days=time_period + ) + return + + # Read data: data = Data._create_dataframe_from_parquet( path=data_set["path"], partition_filter=partition_filter, |