Skip to content

Commit

Permalink
Fix breadbox precomputed associations error
Browse files Browse the repository at this point in the history
  • Loading branch information
snwessel committed Jan 2, 2025
1 parent de31e1f commit 7e3f9d6
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions portal-backend/depmap/interactive/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,8 +705,10 @@ def get_associations_df(matrix_id, x_feature):

@blueprint.route("/api/associations")
def get_associations():
x_id = request.args.get("x")
if x_id.startswith("breadbox/"):
x_id = request.args.get("x") # slice ID

x_dataset_id, x_feature = InteractiveTree.get_dataset_feature_from_id(x_id)
if x_dataset_id.startswith("breadbox/"):
# Associations don't exist for breadbox features (yet at least)
# but we don't want errors when this endpoint is called for a breadbox feature
return jsonify(
Expand All @@ -718,12 +720,11 @@ def get_associations():
}
)
# Everything below this point is deprecated: and not supported for breadbox datasets.
x_dataset, x_feature = InteractiveTree.get_dataset_feature_from_id(x_id)
dataset_label = interactive_utils.get_dataset_label(x_dataset)
dataset_label = interactive_utils.get_dataset_label(x_dataset_id)
if not option_used(
x_feature, x_dataset, "DATASETS"
x_feature, x_dataset_id, "DATASETS"
) or not interactive_utils.is_standard(
x_dataset
x_dataset_id
): # fixme test for this path
return jsonify(
{
Expand All @@ -733,7 +734,7 @@ def get_associations():
"featureLabel": x_feature,
}
)
matrix_id = interactive_utils.get_matrix_id(x_dataset)
matrix_id = interactive_utils.get_matrix_id(x_dataset_id)

df = get_associations_df(matrix_id, x_feature)

Expand Down

0 comments on commit 7e3f9d6

Please sign in to comment.