Skip to content
Snippets Groups Projects

F awi sams

Merged Florian Spreckelsen requested to merge f-awi-sams into main
1 unresolved thread
1 file
+ 4
3
Compare changes
  • Side-by-side
  • Inline
@@ -42,7 +42,7 @@ from caoscrawler.logging import configure_server_side_logging
from bis_utils import (replace_entity_urls_by_ids,
SPECIAL_TREATMENT_SAMPLE, whitespace_cleanup_in_df)
from sample_helpers.utils import CONSTANTS
from sample_helpers.utils import CONSTANTS, get_column_header_name
# suppress warning of diff function
apilogger = logging.getLogger("linkahead.apiutils")
@@ -66,7 +66,7 @@ def get_parser():
def _is_child_sample_table(filename):
tmp_data = pd.read_csv(filename, sep=',')
if 'Parent BIS ID' in tmp_data.columns:
return not tmp_data["Parent BIS ID"].isnull().all()
return not tmp_data[get_column_header_name("Parent LinkAhead ID")].isnull().all()
return False
@@ -171,7 +171,8 @@ def main():
OBLIGATORY_COLUMNS.append(property_name)
try:
data = read_data_from_file(path)
data = replace_entity_urls_by_ids(data, ["BIS ID", "Storage ID", "Parent BIS ID"])
data = replace_entity_urls_by_ids(data, [get_column_header_name(name) for name in [
"entity_id", "Storage ID", "Parent LinkAhead ID"]])
pickle_out = NamedTemporaryFile(delete=False, suffix=".pkl")
data.to_pickle(pickle_out.name)
except DataInconsistencyError as err:
Loading