Skip to content

Commit

Permalink
bugfix: fix bugs for demo
Browse files Browse the repository at this point in the history
  • Loading branch information
EdenWuyifan committed Nov 6, 2024
1 parent 9414987 commit 605eef5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11.6 AS bdi-viz-jupyter
FROM --platform=linux/amd64 python:3.11.6 AS bdi-viz-jupyter

# Install JupyterHub and dependencies
RUN pip3 --disable-pip-version-check install --no-cache-dir \
Expand Down
22 changes: 14 additions & 8 deletions bdiviz/api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import hashlib
import json
import logging
import warnings
from datetime import datetime
from os import getenv, makedirs
from os.path import dirname, exists, expanduser, join
Expand Down Expand Up @@ -40,6 +41,9 @@


logger = logging.getLogger("bdiviz")
warnings.filterwarnings("ignore")
logger_datamart = logging.getLogger("datamart_profiler")
logger_datamart.setLevel(logging.CRITICAL)

pn.extension("tabulator") # type: ignore
pn.extension("mathjax") # type: ignore
Expand Down Expand Up @@ -701,7 +705,7 @@ def _plot_column_histogram(
text_color = "transparent"
else:
values = list(dataset[column].unique())
if len(values) == len(dataset[column]):
if len(values) == len(dataset[column]) or len(values) >= 30:
string = f"""Values are unique.
Some samples: {values[:5]}"""
return pn.pane.Markdown(string)
Expand Down Expand Up @@ -1283,14 +1287,16 @@ def get_recommendations(
self, source: pd.DataFrame, target: pd.DataFrame, top_k: int
) -> List[TopkMatching]:
recommendations = []
for reducings in self.heatmap_recommendations:
recommendations.append(
{
"source_column": reducings["source_column"],
"top_k_columns": [
for source_column in source.columns:
top_k_columns = []
for reducings in self.heatmap_recommendations:
if reducings["source_column"] == source_column:
top_k_columns = [
ColumnScore(column_name=column[0], score=column[1])
for column in reducings["top_k_columns"]
],
}
]
break
recommendations.append(
TopkMatching(source_column=source_column, top_k_columns=top_k_columns)
)
return recommendations

0 comments on commit 605eef5

Please sign in to comment.