def __load_cached_data(self) -> bool: table = DatabaseEntry().get_securities_table() record = table.query() if record is not None and len(record) > 0: self.__cached_data = pd.DataFrame(record) del self.__cached_data['DateTime'] del self.__cached_data['_id'] else: self.__cached_data = pd.DataFrame(column=list(FIELD_INFO.keys())) return True
def __load_cached_data(self, tags: [str]) -> bool: report_type = tags[0] stock_identity = tags[1] data_table = DatabaseEntry().get_finance_table(report_type) record = data_table.query(stock_identity) if record is not None and len(record) > 0: df = pd.DataFrame(record) # del df['DateTime'] del df['_id'] self.__cached_data[report_type][stock_identity] = df return True else: logger.info('FinanceData.load_cached_data() - Not record for + ' + str(tags)) return False