def gen_party_version(namespace, branch='master', create=False): if create: table_name = get_commit_id() else: table_name = get_latest_commit(data_table_namespace=namespace, branch=branch) return table_name
def get_table_info(config, create=False): table_name, namespace, role, party_id, all_party, data_type = config.get('table_name'), \ config.get('namespace'), \ config.get('local', {}).get('role'), \ config.get('local', {}).get('party_id'), \ config.get('role'), \ config.get('data_type') if not config.get('gen_table_info', False): return table_name, namespace if not namespace: namespace = gen_party_namespace(all_party=all_party, data_type=data_type, role=role, party_id=party_id) if not table_name: if create: table_name = get_commit_id() else: table_name = get_latest_commit(data_table_namespace=namespace, branch='master') return table_name, namespace