From ae1a54ebf4fc4907d5a1a0e527c91b38791c7462 Mon Sep 17 00:00:00 2001 From: dgdekoning Date: Fri, 23 Aug 2019 14:56:32 +0200 Subject: [PATCH] Use a method-call so ensure database is actually loaded --- activity_browser/app/bwutils/metadata.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/activity_browser/app/bwutils/metadata.py b/activity_browser/app/bwutils/metadata.py index b31474cb4..787f9ecea 100644 --- a/activity_browser/app/bwutils/metadata.py +++ b/activity_browser/app/bwutils/metadata.py @@ -177,13 +177,13 @@ def index(self): def get_locations(self, db_name: str) -> set: """ Returns a set of locations for the given database name. """ - data = self.dataframe[self.dataframe["database"] == db_name]["location"].unique() + data = self.get_database_metadata(db_name)["location"].unique() return set(data[data != ""]) def get_units(self, db_name: str) -> set: """ Returns a set of units for the given database name. """ - data = self.dataframe[self.dataframe["database"] == db_name]["unit"].unique() + data = self.get_database_metadata(db_name)["unit"].unique() return set(data[data != ""]) def print_convenience_information(self, db_name: str) -> None: