def do_count(table_name): if not table_name: table_name = DEFAULT_TABLE try: index_client = milvus_client() print("get table rows:", table_name) num = count_table(index_client, table_name=table_name) return num except Exception as e: logging.error(e) return "Error with {}".format(e)
def count_tab(table_name): if not table_name: return False try: client = milvus_client() status, ok = has_table(client, table_name) if not ok: return False, '' val = count_table(client, table_name) return True, val except Exception as e: logging.error(e) return '发生错误'.format(e)