From 83342e9be54fd4e2025d40c67b0df1ac28bf5f50 Mon Sep 17 00:00:00 2001 From: chasemc <18691127+chasemc@users.noreply.github.com> Date: Mon, 18 Mar 2024 10:22:10 -0500 Subject: [PATCH 1/2] fix: neo4j admin import relationship labels --- socialgene/neo4j/utils/admin_import.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/socialgene/neo4j/utils/admin_import.py b/socialgene/neo4j/utils/admin_import.py index 207e93c4..b08f9d76 100644 --- a/socialgene/neo4j/utils/admin_import.py +++ b/socialgene/neo4j/utils/admin_import.py @@ -1,6 +1,7 @@ import os from pathlib import Path +from socialgene.neo4j.neo4j_element import Node from socialgene.neo4j.schema.socialgene_modules import SocialgeneModules from socialgene.utils.logging import log from socialgene.utils.run_subprocess import run_subprocess @@ -110,11 +111,14 @@ def _single_arg_string_builder(input, type): list: [first_part_of_arg_string, header_path_string, data_glob_string] want mutable because will check in later step for gz and append if needed """ cli_label = "" - if len(input.neo4j_label) > 1: - # labels are set in-file - cli_label = "" + if isinstance(input, Node): + if len(input.neo4j_label) > 1: + # labels are set in-file + cli_label = "" + else: + cli_label = f"{input.neo4j_label[0]}=" else: - cli_label = f"{input.neo4j_label[0]}=" + cli_label = f"{input.neo4j_label}=" return [ f"--{type}={cli_label}", f"import/neo4j_headers/{input.header_filename}", From d1d828e2c41faa441128f9e9996ec64dcc6e6fdd Mon Sep 17 00:00:00 2001 From: chasemc <18691127+chasemc@users.noreply.github.com> Date: Mon, 18 Mar 2024 10:31:37 -0500 Subject: [PATCH 2/2] fix: node/rel neo4j admin import command --- socialgene/neo4j/utils/admin_import.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/socialgene/neo4j/utils/admin_import.py b/socialgene/neo4j/utils/admin_import.py index b08f9d76..e2af8464 100644 --- a/socialgene/neo4j/utils/admin_import.py +++ b/socialgene/neo4j/utils/admin_import.py @@ -111,7 +111,7 @@ def _single_arg_string_builder(input, type): list: [first_part_of_arg_string, header_path_string, data_glob_string] want mutable because will check in later step for gz and append if needed """ cli_label = "" - if isinstance(input, Node): + if issubclass(input, Node): if len(input.neo4j_label) > 1: # labels are set in-file cli_label = ""