Skip to content

Commit

Permalink
api: update init_columns() for sampling
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaume committed Oct 3, 2022
1 parent 315eb4c commit 041359c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mpcontribs-api/mpcontribs/api/projects/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,10 @@ def post_save(cls, sender, document, **kwargs):
flat = flatten(remap(merged, visit=visit, enter=enter), reducer="dot")

for k, v in flat.items():
path = f"data.{k}"
columns[path] = Column(path=path)
if v is not None:
columns[path].unit = v
if k.startswith("data."):
columns[k] = Column(path=k)
if v is not None:
columns[k].unit = v

# start pipeline for stats: match project
pipeline = [{"$match": {"project": document.id}}]
Expand Down

0 comments on commit 041359c

Please sign in to comment.