C-Dash: URLs to jobs and builds
[csit.git] / csit.infra.dash / app / cdash / data / data.py
index ce98476..41033a7 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2023 Cisco and/or its affiliates.
+# Copyright (c) 2024 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -400,11 +400,16 @@ class Data:
         )
         for key in self._data.keys():
             logging.info(f"\n\nDataframe {key}:\n")
-            self._data[key] = pd.concat(
-                data_lists[key],
-                ignore_index=True,
-                copy=False
-            )    
+            if len(data_lists[key]) == 0:
+                self._data[key] = pd.DataFrame()
+            elif len(data_lists[key]) == 1:
+                self._data[key] = data_lists[key][0]
+            else:
+                self._data[key] = pd.concat(
+                    data_lists[key],
+                    ignore_index=True,
+                    copy=False
+                )
             self._data[key].info(verbose=True, memory_usage="deep")
             err_msg = self._validate_columns(key)
             if err_msg: