From 38fd1e93566b9ed91c98b32a658cb995141e12ce Mon Sep 17 00:00:00 2001 From: evilchili Date: Fri, 19 Jan 2024 00:02:35 -0800 Subject: [PATCH] fix bug where flatten() excluded the option --- random_sets/datasources.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/random_sets/datasources.py b/random_sets/datasources.py index 4d288a1..54f56fd 100644 --- a/random_sets/datasources.py +++ b/random_sets/datasources.py @@ -122,9 +122,9 @@ class DataSource: """ # If there is no data for the specified option, stop now. - flattened = [] + flattened = [option] if not self.data[option]: - return [option] + flattened if hasattr(self.data[option], 'keys'): # if the option is a dict, we assume the values are lists; we select a random item