Skip to content

Commit

Permalink
add admin dq as dataowner of nodes too
Browse files Browse the repository at this point in the history
  • Loading branch information
vemonet committed Apr 8, 2024
1 parent 16c0d28 commit 47e2d2e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion backend/src/decentriq.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ def create_provision_dcr(user: Any, cohort: Cohort) -> dict[str, Any]:
user["email"],
data_owner_of=[data_node_id],
)
builder.add_participant(
settings.decentriq_email,
data_owner_of=[data_node_id],
)
# Build and publish DCR
dcr_definition = builder.build()
dcr = client.publish_analytics_dcr(dcr_definition)
Expand Down Expand Up @@ -114,7 +118,7 @@ async def create_compute_dcr(
user: Any = Depends(get_current_user),
) -> dict[str, Any]:
"""Create a Data Clean Room for computing with the cohorts requested using Decentriq SDK"""
users = [user["email"]]
# users = [user["email"]]
# TODO: cohorts_request could also be a dict of union of cohorts to merge
# {"cohorts": {"cohort_id": ["var1", "var2"], "merged_cohort3": {"cohort1": ["weight", "sex"], "cohort2": ["gender", "patient weight"]}}}
# We automatically merge the cohorts, figuring out which variables are the same thanks to mappings
Expand Down Expand Up @@ -197,6 +201,7 @@ async def create_compute_dcr(

# Add users permissions
builder.add_participant(user["email"], data_owner_of=data_nodes, analyst_of=["prepare-data", *preview_nodes])
builder.add_participant(settings.decentriq_email, data_owner_of=data_nodes, analyst_of=["prepare-data", *preview_nodes])

# Build and publish DCR
dcr_definition = builder.build()
Expand Down
1 change: 1 addition & 0 deletions backend/src/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ def load_cohort_dict_file(dict_path: str, cohort_id: str, user_email: str) -> Da
)
try:
df = pd.read_csv(dict_path)
# df = pd.read_csv(dict_path, encoding="utf-8")
df = df.dropna(how="all")
df = df.fillna("")
df.columns = df.columns.str.strip()
Expand Down

0 comments on commit 47e2d2e

Please sign in to comment.