Skip to content

Commit

Permalink
Updated new visualizations to match syntax of kubeflow#1878
Browse files Browse the repository at this point in the history
  • Loading branch information
ajchili committed Aug 21, 2019
1 parent 6cc4886 commit baafb2e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
17 changes: 9 additions & 8 deletions backend/src/apiserver/visualization/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,25 @@
import pandas as pd
from tensorflow.python.lib.io import file_io

# Remove maxByte limit
# Remove maxByte limit to prevent issues where entire table cannot be rendered
# due to size of data.
opts.maxBytes = 0

dfs = []
files = file_io.get_matching_files(source)

# Read data from file and write it to a DataFrame object.
if "headers" is in variables:
# If headers are provided, do not set headers for DataFrames
for f in files:
dfs.append(pd.read_csv(f, header=None))
else:
if variables.get("headers", False) is False:
# If no headers are provided, use the first row as headers
for f in files:
dfs.append(pd.read_csv(f))
else:
# If headers are provided, do not set headers for DataFrames
for f in files:
dfs.append(pd.read_csv(f, header=None))

# Display DataFrame as output.
df = pd.concat(dfs)
if "headers" is in variables:
df.columns = variables["headers"]
if variables.get("headers", False) != False:
df.columns = variables.get("headers")
show(df)
6 changes: 3 additions & 3 deletions backend/src/apiserver/visualization/tfma.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
#
# source

if "slicing_column" in variables {
tfma.view.render_slicing_metrics(source, slicing_column=variables["slicing_column"])
} else {
if variables.get("slicing_column", False) is False {
tfma.view.render_slicing_metrics(source)
} else {
tfma.view.render_slicing_metrics(source, slicing_column=variables.get("slicing_column"))
}

0 comments on commit baafb2e

Please sign in to comment.