Skip to content

Commit

Permalink
fix asn data mapping to model
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram committed Jul 15, 2024
1 parent 3aa7d90 commit 89e8262
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/stpipe/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ def __init__(

# load association
asn_data = self._load_asn(asn_path)

# store the basename of the input file as the table_name
asn_data["table_name"] = os.path.basename(asn_path)
elif isinstance(init, MutableMapping):
# init is an association "dictionary"
# we will modify the asn below so do a deep copy
Expand Down Expand Up @@ -540,8 +543,10 @@ def _assign_member_to_model(self, model, member):
if not hasattr(model.meta, "asn"):
model.meta.asn = {}

model.meta.asn["table_name"] = self.asn.get("table_name", "")
model.meta.asn["pool_name"] = self.asn.get("asn_pool", "")
if "table_name" in self.asn:
model.meta.asn["table_name"] = self.asn["table_name"]
if "asn_pool" in self.asn:
model.meta.asn["pool_name"] = self.asn["asn_pool"]

def _load_member(self, index):
"""
Expand Down

0 comments on commit 89e8262

Please sign in to comment.