Skip to content

Commit 433c1f4

Browse files
Assert that data is provided by one method
1 parent d6da6a3 commit 433c1f4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

causal_testing/json_front/json_class.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ def setup(self, scenario: Scenario):
8181
# Populate the data
8282
if self.input_paths.data_paths:
8383
self.data = pd.concat([pd.read_csv(data_file, header=0) for data_file in self.input_paths.data_paths])
84+
if len(self.data) == 0:
85+
raise ValueError("No data found, either provide a path to a file containing data or manually populate the .data attribute with a dataframe before calling .setup()")
8486
self._populate_metas()
8587

8688
def _create_abstract_test_case(self, test, mutates, effects):

0 commit comments

Comments
 (0)