Skip to content
Snippets Groups Projects
Commit 6e4714ae authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

ENH: overwrite parents if they exist

parent b0abb362
No related branches found
No related tags found
2 merge requests!160STY: styling,!130Overwrite parents
Pipeline #40898 canceled
......@@ -24,29 +24,29 @@
#
from __future__ import annotations
from jsonschema import validate, ValidationError
import os
import re
import datetime
import caosdb as db
import json
import logging
import os
import re
import warnings
from .utils import has_parent
from .stores import GeneralStore, RecordStore
from .structure_elements import (StructureElement, Directory, File, DictElement, JSONFile,
IntegerElement, BooleanElement, FloatElement, NoneElement,
TextElement, TextElement, ListElement)
from typing import List, Optional, Tuple, Union
from abc import ABCMeta, abstractmethod
from string import Template
import yaml_header_tools
from typing import List, Optional, Tuple, Union
import caosdb as db
import pandas as pd
import logging
import yaml
import yaml_header_tools
from jsonschema import ValidationError, validate
from .stores import GeneralStore, RecordStore
from .structure_elements import (BooleanElement, DictElement, Directory, File,
FloatElement, IntegerElement, JSONFile,
ListElement, NoneElement, StructureElement,
TextElement)
from .utils import has_parent
# These are special properties which are (currently) treated differently
# by the converters:
......@@ -300,6 +300,7 @@ def create_records(values: GeneralStore, records: RecordStore, def_records: dict
# no matter whether the record existed in the record store or not,
# parents will be added when they aren't present in the record yet:
if "parents" in record:
c_record.parents.clear()
for parent in record["parents"]:
# Do the variables replacement:
var_replaced_parent = replace_variables(parent, values)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment