chore: migrate use_container_width → width (Streamlit deprecation)
``use_container_width`` is being removed after 2025-12-31. Streamlit log was flooding the terminal with the deprecation notice on every rerun. Mechanical sweep: use_container_width=True → width="stretch" use_container_width=False → width="content" 51 call sites across 11 page files + ``app_demo.py``. Also renamed the ``local_download_button`` helper's ``use_container_width`` kwarg to ``width`` (default ``"stretch"``); it has no external callers passing the old name, so this is a safe rename. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -174,7 +174,7 @@ def _home_page() -> None:
|
|||||||
key=f"_home_remove_{digest}",
|
key=f"_home_remove_{digest}",
|
||||||
help=f"Remove {name}",
|
help=f"Remove {name}",
|
||||||
type="secondary",
|
type="secondary",
|
||||||
use_container_width=True,
|
width="stretch",
|
||||||
):
|
):
|
||||||
to_remove = name
|
to_remove = name
|
||||||
|
|
||||||
@@ -240,14 +240,14 @@ def _home_page() -> None:
|
|||||||
type="primary",
|
type="primary",
|
||||||
key="home_run_analysis",
|
key="home_run_analysis",
|
||||||
disabled=not pending,
|
disabled=not pending,
|
||||||
use_container_width=True,
|
width="stretch",
|
||||||
)
|
)
|
||||||
with col_clear:
|
with col_clear:
|
||||||
clear_clicked = st.button(
|
clear_clicked = st.button(
|
||||||
t("upload.clear_results"),
|
t("upload.clear_results"),
|
||||||
key="home_clear_results",
|
key="home_clear_results",
|
||||||
disabled=not findings_by_file,
|
disabled=not findings_by_file,
|
||||||
use_container_width=True,
|
width="stretch",
|
||||||
)
|
)
|
||||||
|
|
||||||
if clear_clicked:
|
if clear_clicked:
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ else:
|
|||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
st.markdown(f"#### BEFORE — {len(df_in)} rows, {len(df_in.columns)} columns")
|
st.markdown(f"#### BEFORE — {len(df_in)} rows, {len(df_in.columns)} columns")
|
||||||
st.dataframe(df_in.head(10), use_container_width=True, hide_index=True)
|
st.dataframe(df_in.head(10), width="stretch", hide_index=True)
|
||||||
|
|
||||||
st.markdown("---")
|
st.markdown("---")
|
||||||
|
|
||||||
@@ -338,7 +338,7 @@ st.markdown(pipe_summary)
|
|||||||
run_clicked = st.button(
|
run_clicked = st.button(
|
||||||
"▶ Run pipeline",
|
"▶ Run pipeline",
|
||||||
type="primary",
|
type="primary",
|
||||||
use_container_width=True,
|
width="stretch",
|
||||||
key="demo_run_button",
|
key="demo_run_button",
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -404,7 +404,7 @@ if result is not None:
|
|||||||
)
|
)
|
||||||
st.markdown("".join(pills_html), unsafe_allow_html=True)
|
st.markdown("".join(pills_html), unsafe_allow_html=True)
|
||||||
|
|
||||||
st.dataframe(result.final_df.head(10), use_container_width=True, hide_index=True)
|
st.dataframe(result.final_df.head(10), width="stretch", hide_index=True)
|
||||||
|
|
||||||
# ----- Download with watermark row -----
|
# ----- Download with watermark row -----
|
||||||
watermark_row = pd.DataFrame([{
|
watermark_row = pd.DataFrame([{
|
||||||
@@ -422,7 +422,7 @@ if result is not None:
|
|||||||
data=csv_bytes,
|
data=csv_bytes,
|
||||||
file_name=Path(persona["data_file"]).stem + "_cleaned_demo.csv",
|
file_name=Path(persona["data_file"]).stem + "_cleaned_demo.csv",
|
||||||
mime="text/csv",
|
mime="text/csv",
|
||||||
use_container_width=True,
|
width="stretch",
|
||||||
)
|
)
|
||||||
with col_cta:
|
with col_cta:
|
||||||
st.markdown(
|
st.markdown(
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ def _render_diagnostics_sidebar() -> None:
|
|||||||
"📂 Open log folder",
|
"📂 Open log folder",
|
||||||
key="_diag_open_logs",
|
key="_diag_open_logs",
|
||||||
type="secondary",
|
type="secondary",
|
||||||
use_container_width=True,
|
width="stretch",
|
||||||
):
|
):
|
||||||
opened = _open_in_file_manager(audit_log_dir(), select=log_path)
|
opened = _open_in_file_manager(audit_log_dir(), select=log_path)
|
||||||
if not opened:
|
if not opened:
|
||||||
@@ -448,7 +448,7 @@ def local_download_button(
|
|||||||
mime: str = "application/octet-stream", # noqa: ARG001 — kept for API compat
|
mime: str = "application/octet-stream", # noqa: ARG001 — kept for API compat
|
||||||
disabled: bool = False,
|
disabled: bool = False,
|
||||||
help: str | None = None,
|
help: str | None = None,
|
||||||
use_container_width: bool = True,
|
width: str = "stretch",
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Save bytes directly to the user's Downloads folder.
|
"""Save bytes directly to the user's Downloads folder.
|
||||||
|
|
||||||
@@ -497,7 +497,7 @@ def local_download_button(
|
|||||||
disabled=disabled,
|
disabled=disabled,
|
||||||
help=help,
|
help=help,
|
||||||
type="secondary",
|
type="secondary",
|
||||||
use_container_width=use_container_width,
|
width=width,
|
||||||
)
|
)
|
||||||
|
|
||||||
if clicked:
|
if clicked:
|
||||||
@@ -1412,7 +1412,7 @@ def match_group_card(
|
|||||||
return styles
|
return styles
|
||||||
|
|
||||||
styled = compare_df.style.apply(_highlight_diffs, axis=0)
|
styled = compare_df.style.apply(_highlight_diffs, axis=0)
|
||||||
st.dataframe(styled, use_container_width=True)
|
st.dataframe(styled, width="stretch")
|
||||||
|
|
||||||
if len(keep_indices) == n_rows:
|
if len(keep_indices) == n_rows:
|
||||||
st.info("Decision: Kept All")
|
st.info("Decision: Kept All")
|
||||||
@@ -1470,7 +1470,7 @@ def match_group_card(
|
|||||||
editor_df,
|
editor_df,
|
||||||
column_config=col_config,
|
column_config=col_config,
|
||||||
disabled=disabled_cols,
|
disabled=disabled_cols,
|
||||||
use_container_width=True,
|
width="stretch",
|
||||||
hide_index=True,
|
hide_index=True,
|
||||||
key=f"editor_{gid}",
|
key=f"editor_{gid}",
|
||||||
)
|
)
|
||||||
@@ -1514,7 +1514,7 @@ def match_group_card(
|
|||||||
columns=["Keep"],
|
columns=["Keep"],
|
||||||
).reset_index(drop=True)
|
).reset_index(drop=True)
|
||||||
st.markdown("**Surviving rows preview:**")
|
st.markdown("**Surviving rows preview:**")
|
||||||
st.dataframe(preview, use_container_width=True, hide_index=True)
|
st.dataframe(preview, width="stretch", hide_index=True)
|
||||||
|
|
||||||
# Confirm
|
# Confirm
|
||||||
def _on_confirm(
|
def _on_confirm(
|
||||||
@@ -1848,7 +1848,7 @@ def render_findings_panel(
|
|||||||
_t("findings.open_tool", tool=name),
|
_t("findings.open_tool", tool=name),
|
||||||
key=f"_findings_open_{tool_id}_{ns}",
|
key=f"_findings_open_{tool_id}_{ns}",
|
||||||
type="primary",
|
type="primary",
|
||||||
use_container_width=False,
|
width="content",
|
||||||
):
|
):
|
||||||
st.switch_page(page_slug)
|
st.switch_page(page_slug)
|
||||||
|
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ if uploaded is not None:
|
|||||||
# markdown/caption/subheader collections.
|
# markdown/caption/subheader collections.
|
||||||
st.subheader(f"Preview: {uploaded.name}")
|
st.subheader(f"Preview: {uploaded.name}")
|
||||||
st.caption(f"{len(df)} rows, {len(df.columns)} columns")
|
st.caption(f"{len(df)} rows, {len(df.columns)} columns")
|
||||||
st.dataframe(df.head(10), use_container_width=True)
|
st.dataframe(df.head(10), width="stretch")
|
||||||
|
|
||||||
# Advanced options
|
# Advanced options
|
||||||
with st.expander("Options", expanded=not _has_result):
|
with st.expander("Options", expanded=not _has_result):
|
||||||
@@ -213,7 +213,7 @@ if uploaded is not None:
|
|||||||
|
|
||||||
st.divider()
|
st.divider()
|
||||||
|
|
||||||
if st.button("Find Duplicates", type="primary", use_container_width=True):
|
if st.button("Find Duplicates", type="primary", width="stretch"):
|
||||||
progress_bar = st.progress(0, text="Comparing rows...")
|
progress_bar = st.progress(0, text="Comparing rows...")
|
||||||
|
|
||||||
def _gui_progress(current: int, total: int) -> None:
|
def _gui_progress(current: int, total: int) -> None:
|
||||||
@@ -350,7 +350,7 @@ if uploaded is not None:
|
|||||||
if st.button(
|
if st.button(
|
||||||
"Apply Review Decisions & Download",
|
"Apply Review Decisions & Download",
|
||||||
type="primary",
|
type="primary",
|
||||||
use_container_width=True,
|
width="stretch",
|
||||||
):
|
):
|
||||||
reviewed_df, reviewed_removed = apply_review_decisions(
|
reviewed_df, reviewed_removed = apply_review_decisions(
|
||||||
df, result.match_groups, decisions,
|
df, result.match_groups, decisions,
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ with st.expander(f"Preview: {uploaded.name}", expanded=not _has_result):
|
|||||||
if preview_show_hidden:
|
if preview_show_hidden:
|
||||||
render_hidden_aware_preview(df, n_rows=10)
|
render_hidden_aware_preview(df, n_rows=10)
|
||||||
else:
|
else:
|
||||||
st.dataframe(df.head(10), use_container_width=True)
|
st.dataframe(df.head(10), width="stretch")
|
||||||
|
|
||||||
st.divider()
|
st.divider()
|
||||||
|
|
||||||
@@ -213,7 +213,7 @@ with st.expander("Options", expanded=not _has_result):
|
|||||||
|
|
||||||
st.divider()
|
st.divider()
|
||||||
|
|
||||||
if st.button("Clean Text", type="primary", use_container_width=True):
|
if st.button("Clean Text", type="primary", width="stretch"):
|
||||||
with st.spinner("Cleaning..."):
|
with st.spinner("Cleaning..."):
|
||||||
try:
|
try:
|
||||||
result = clean_dataframe(df, options)
|
result = clean_dataframe(df, options)
|
||||||
@@ -280,7 +280,7 @@ if result.cells_changed:
|
|||||||
st.markdown("**Changes by column**")
|
st.markdown("**Changes by column**")
|
||||||
st.dataframe(
|
st.dataframe(
|
||||||
counts.rename("cells_changed").to_frame(),
|
counts.rename("cells_changed").to_frame(),
|
||||||
use_container_width=True,
|
width="stretch",
|
||||||
)
|
)
|
||||||
|
|
||||||
st.markdown("**Examples (first 25 changes)**")
|
st.markdown("**Examples (first 25 changes)**")
|
||||||
@@ -326,7 +326,7 @@ if result.cells_changed:
|
|||||||
unsafe_allow_html=True,
|
unsafe_allow_html=True,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
st.dataframe(examples, use_container_width=True, hide_index=True)
|
st.dataframe(examples, width="stretch", hide_index=True)
|
||||||
|
|
||||||
st.markdown("**Cleaned preview (first 10 rows)**")
|
st.markdown("**Cleaned preview (first 10 rows)**")
|
||||||
# Reuse the same toggle the Examples table uses so the user controls both
|
# Reuse the same toggle the Examples table uses so the user controls both
|
||||||
@@ -334,7 +334,7 @@ st.markdown("**Cleaned preview (first 10 rows)**")
|
|||||||
if show_hidden:
|
if show_hidden:
|
||||||
render_hidden_aware_preview(result.cleaned_df, n_rows=10)
|
render_hidden_aware_preview(result.cleaned_df, n_rows=10)
|
||||||
else:
|
else:
|
||||||
st.dataframe(result.cleaned_df.head(10), use_container_width=True)
|
st.dataframe(result.cleaned_df.head(10), width="stretch")
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Downloads
|
# Downloads
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ except Exception as e:
|
|||||||
_has_result = st.session_state.get("fmtstd_result") is not None
|
_has_result = st.session_state.get("fmtstd_result") is not None
|
||||||
with st.expander(f"Preview: {uploaded.name}", expanded=not _has_result):
|
with st.expander(f"Preview: {uploaded.name}", expanded=not _has_result):
|
||||||
st.caption(f"{len(df)} rows, {len(df.columns)} columns")
|
st.caption(f"{len(df)} rows, {len(df.columns)} columns")
|
||||||
st.dataframe(df.head(10), use_container_width=True)
|
st.dataframe(df.head(10), width="stretch")
|
||||||
st.divider()
|
st.divider()
|
||||||
|
|
||||||
|
|
||||||
@@ -478,7 +478,7 @@ with st.expander("Options", expanded=not _has_result):
|
|||||||
edited = st.data_editor(
|
edited = st.data_editor(
|
||||||
starter,
|
starter,
|
||||||
num_rows="dynamic",
|
num_rows="dynamic",
|
||||||
use_container_width=True,
|
width="stretch",
|
||||||
column_config={
|
column_config={
|
||||||
"abbreviation": st.column_config.TextColumn(
|
"abbreviation": st.column_config.TextColumn(
|
||||||
"Short form",
|
"Short form",
|
||||||
@@ -530,7 +530,7 @@ run_disabled = not column_types
|
|||||||
if st.button(
|
if st.button(
|
||||||
"Standardize Formats",
|
"Standardize Formats",
|
||||||
type="primary",
|
type="primary",
|
||||||
use_container_width=True,
|
width="stretch",
|
||||||
disabled=run_disabled,
|
disabled=run_disabled,
|
||||||
):
|
):
|
||||||
with st.spinner("Standardizing..."):
|
with st.spinner("Standardizing..."):
|
||||||
@@ -592,16 +592,16 @@ if result.cells_changed:
|
|||||||
st.markdown("**Changes by column**")
|
st.markdown("**Changes by column**")
|
||||||
st.dataframe(
|
st.dataframe(
|
||||||
counts.rename("cells_changed").to_frame(),
|
counts.rename("cells_changed").to_frame(),
|
||||||
use_container_width=True,
|
width="stretch",
|
||||||
)
|
)
|
||||||
|
|
||||||
st.markdown("**Examples (first 25 changes)**")
|
st.markdown("**Examples (first 25 changes)**")
|
||||||
examples = result.changes.head(25).copy()
|
examples = result.changes.head(25).copy()
|
||||||
examples["row"] = examples["row"] + 1
|
examples["row"] = examples["row"] + 1
|
||||||
st.dataframe(examples, use_container_width=True, hide_index=True)
|
st.dataframe(examples, width="stretch", hide_index=True)
|
||||||
|
|
||||||
st.markdown("**Standardized preview (first 10 rows)**")
|
st.markdown("**Standardized preview (first 10 rows)**")
|
||||||
st.dataframe(result.standardized_df.head(10), use_container_width=True)
|
st.dataframe(result.standardized_df.head(10), width="stretch")
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ _has_result = st.session_state.get("missing_result") is not None
|
|||||||
|
|
||||||
with st.expander(f"Preview: {uploaded.name}", expanded=not _has_result):
|
with st.expander(f"Preview: {uploaded.name}", expanded=not _has_result):
|
||||||
st.caption(f"{len(df)} rows, {len(df.columns)} columns")
|
st.caption(f"{len(df)} rows, {len(df.columns)} columns")
|
||||||
st.dataframe(df.head(10), use_container_width=True)
|
st.dataframe(df.head(10), width="stretch")
|
||||||
|
|
||||||
st.divider()
|
st.divider()
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ with st.expander("Options", expanded=not _has_result):
|
|||||||
m3.metric("% cells missing", f"{initial_profile.cells_missing_pct:.1f}%")
|
m3.metric("% cells missing", f"{initial_profile.cells_missing_pct:.1f}%")
|
||||||
m4.metric("Complete rows", initial_profile.rows_complete)
|
m4.metric("Complete rows", initial_profile.rows_complete)
|
||||||
|
|
||||||
st.dataframe(prof_df, use_container_width=True, hide_index=True)
|
st.dataframe(prof_df, width="stretch", hide_index=True)
|
||||||
|
|
||||||
if initial_profile.cells_missing == 0:
|
if initial_profile.cells_missing == 0:
|
||||||
st.success("No missing values or disguised nulls detected. Nothing to handle.")
|
st.success("No missing values or disguised nulls detected. Nothing to handle.")
|
||||||
@@ -259,7 +259,7 @@ with st.expander("Options", expanded=not _has_result):
|
|||||||
})
|
})
|
||||||
edited = st.data_editor(
|
edited = st.data_editor(
|
||||||
edit_df,
|
edit_df,
|
||||||
use_container_width=True,
|
width="stretch",
|
||||||
hide_index=True,
|
hide_index=True,
|
||||||
column_config={
|
column_config={
|
||||||
"column": st.column_config.TextColumn("Column", disabled=True),
|
"column": st.column_config.TextColumn("Column", disabled=True),
|
||||||
@@ -285,7 +285,7 @@ with st.expander("Options", expanded=not _has_result):
|
|||||||
|
|
||||||
st.divider()
|
st.divider()
|
||||||
|
|
||||||
if st.button("Handle Missing Values", type="primary", use_container_width=True):
|
if st.button("Handle Missing Values", type="primary", width="stretch"):
|
||||||
with st.spinner("Handling..."):
|
with st.spinner("Handling..."):
|
||||||
try:
|
try:
|
||||||
result = handle_missing(df, options)
|
result = handle_missing(df, options)
|
||||||
@@ -345,25 +345,25 @@ after = result.profile_after.to_dataframe().set_index("column")[
|
|||||||
["missing", "missing_pct"]
|
["missing", "missing_pct"]
|
||||||
].rename(columns={"missing": "after_missing", "missing_pct": "after_pct"})
|
].rename(columns={"missing": "after_missing", "missing_pct": "after_pct"})
|
||||||
combined = before.join(after, how="outer").fillna(0)
|
combined = before.join(after, how="outer").fillna(0)
|
||||||
st.dataframe(combined, use_container_width=True)
|
st.dataframe(combined, width="stretch")
|
||||||
|
|
||||||
if result.strategy_per_column:
|
if result.strategy_per_column:
|
||||||
st.markdown("**Strategy applied per column**")
|
st.markdown("**Strategy applied per column**")
|
||||||
strat_df = pd.DataFrame(
|
strat_df = pd.DataFrame(
|
||||||
[{"column": c, "strategy": s} for c, s in result.strategy_per_column.items()]
|
[{"column": c, "strategy": s} for c, s in result.strategy_per_column.items()]
|
||||||
)
|
)
|
||||||
st.dataframe(strat_df, use_container_width=True, hide_index=True)
|
st.dataframe(strat_df, width="stretch", hide_index=True)
|
||||||
|
|
||||||
if not result.changes.empty:
|
if not result.changes.empty:
|
||||||
st.markdown("**Audit (first 50 changes)**")
|
st.markdown("**Audit (first 50 changes)**")
|
||||||
audit_view = result.changes.head(50).copy()
|
audit_view = result.changes.head(50).copy()
|
||||||
audit_view["row"] = audit_view["row"].apply(lambda x: "—" if x == -1 else x + 1)
|
audit_view["row"] = audit_view["row"].apply(lambda x: "—" if x == -1 else x + 1)
|
||||||
st.dataframe(audit_view, use_container_width=True, hide_index=True)
|
st.dataframe(audit_view, width="stretch", hide_index=True)
|
||||||
if len(result.changes) > 50:
|
if len(result.changes) > 50:
|
||||||
st.caption(f"… and {len(result.changes) - 50} more (download the full audit below).")
|
st.caption(f"… and {len(result.changes) - 50} more (download the full audit below).")
|
||||||
|
|
||||||
st.markdown("**Handled preview (first 10 rows)**")
|
st.markdown("**Handled preview (first 10 rows)**")
|
||||||
st.dataframe(result.handled_df.head(10), use_container_width=True)
|
st.dataframe(result.handled_df.head(10), width="stretch")
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Downloads
|
# Downloads
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ _has_result = st.session_state.get("colmap_result") is not None
|
|||||||
|
|
||||||
with st.expander(f"Preview: {uploaded.name}", expanded=not _has_result):
|
with st.expander(f"Preview: {uploaded.name}", expanded=not _has_result):
|
||||||
st.caption(f"{len(df)} rows, {len(df.columns)} columns")
|
st.caption(f"{len(df)} rows, {len(df.columns)} columns")
|
||||||
st.dataframe(df.head(10), use_container_width=True)
|
st.dataframe(df.head(10), width="stretch")
|
||||||
st.divider()
|
st.divider()
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
@@ -165,7 +165,7 @@ with st.expander("Options", expanded=not _has_result):
|
|||||||
})
|
})
|
||||||
edited = st.data_editor(
|
edited = st.data_editor(
|
||||||
initial,
|
initial,
|
||||||
use_container_width=True,
|
width="stretch",
|
||||||
num_rows="dynamic",
|
num_rows="dynamic",
|
||||||
column_config={
|
column_config={
|
||||||
"name": st.column_config.TextColumn("Target name"),
|
"name": st.column_config.TextColumn("Target name"),
|
||||||
@@ -276,7 +276,7 @@ with st.expander("Options", expanded=not _has_result):
|
|||||||
})
|
})
|
||||||
rename_edited = st.data_editor(
|
rename_edited = st.data_editor(
|
||||||
rename_initial,
|
rename_initial,
|
||||||
use_container_width=True,
|
width="stretch",
|
||||||
column_config={
|
column_config={
|
||||||
"source": st.column_config.TextColumn("Source", disabled=True),
|
"source": st.column_config.TextColumn("Source", disabled=True),
|
||||||
"target": st.column_config.TextColumn("Target"),
|
"target": st.column_config.TextColumn("Target"),
|
||||||
@@ -304,7 +304,7 @@ with st.expander("Options", expanded=not _has_result):
|
|||||||
})
|
})
|
||||||
map_edited = st.data_editor(
|
map_edited = st.data_editor(
|
||||||
map_initial,
|
map_initial,
|
||||||
use_container_width=True,
|
width="stretch",
|
||||||
column_config={
|
column_config={
|
||||||
"source": st.column_config.TextColumn("Source", disabled=True),
|
"source": st.column_config.TextColumn("Source", disabled=True),
|
||||||
"target": st.column_config.SelectboxColumn(
|
"target": st.column_config.SelectboxColumn(
|
||||||
@@ -332,7 +332,7 @@ with st.expander("Options", expanded=not _has_result):
|
|||||||
|
|
||||||
st.divider()
|
st.divider()
|
||||||
|
|
||||||
if st.button("Apply Column Mapping", type="primary", use_container_width=True):
|
if st.button("Apply Column Mapping", type="primary", width="stretch"):
|
||||||
with st.spinner("Mapping..."):
|
with st.spinner("Mapping..."):
|
||||||
try:
|
try:
|
||||||
result = map_columns(df, options)
|
result = map_columns(df, options)
|
||||||
@@ -400,10 +400,10 @@ if result.mapping:
|
|||||||
for s, t in result.mapping.items()
|
for s, t in result.mapping.items()
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
st.dataframe(map_df, use_container_width=True, hide_index=True)
|
st.dataframe(map_df, width="stretch", hide_index=True)
|
||||||
|
|
||||||
st.markdown("**Mapped preview (first 10 rows)**")
|
st.markdown("**Mapped preview (first 10 rows)**")
|
||||||
st.dataframe(result.mapped_df.head(10), use_container_width=True)
|
st.dataframe(result.mapped_df.head(10), width="stretch")
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Downloads
|
# Downloads
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ if uploaded is not None:
|
|||||||
df = pd.read_csv(uploaded)
|
df = pd.read_csv(uploaded)
|
||||||
st.subheader(f"Preview: {uploaded.name}")
|
st.subheader(f"Preview: {uploaded.name}")
|
||||||
st.caption(f"{len(df)} rows, {len(df.columns)} columns")
|
st.caption(f"{len(df)} rows, {len(df.columns)} columns")
|
||||||
st.dataframe(df.head(10), use_container_width=True)
|
st.dataframe(df.head(10), width="stretch")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
from src.core.errors import format_for_user
|
from src.core.errors import format_for_user
|
||||||
st.error(
|
st.error(
|
||||||
@@ -95,5 +95,5 @@ st.subheader("Handling")
|
|||||||
st.selectbox("Action", ["Flag only (add column)", "Remove outlier rows", "Cap / Winsorize to bounds"], disabled=True)
|
st.selectbox("Action", ["Flag only (add column)", "Remove outlier rows", "Cap / Winsorize to bounds"], disabled=True)
|
||||||
|
|
||||||
st.divider()
|
st.divider()
|
||||||
st.button("Detect Outliers", type="primary", use_container_width=True, disabled=True)
|
st.button("Detect Outliers", type="primary", width="stretch", disabled=True)
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ if uploaded_files:
|
|||||||
df = pd.read_csv(f)
|
df = pd.read_csv(f)
|
||||||
st.subheader(f"Preview: {f.name}")
|
st.subheader(f"Preview: {f.name}")
|
||||||
st.caption(f"{len(df)} rows, {len(df.columns)} columns — Columns: {', '.join(df.columns[:10])}{'...' if len(df.columns) > 10 else ''}")
|
st.caption(f"{len(df)} rows, {len(df.columns)} columns — Columns: {', '.join(df.columns[:10])}{'...' if len(df.columns) > 10 else ''}")
|
||||||
st.dataframe(df.head(5), use_container_width=True)
|
st.dataframe(df.head(5), width="stretch")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
from src.core.errors import format_for_user
|
from src.core.errors import format_for_user
|
||||||
st.error(
|
st.error(
|
||||||
@@ -93,5 +93,5 @@ st.selectbox("Mismatched columns", ["Fill with null", "Drop non-shared columns",
|
|||||||
st.checkbox("Add source filename column", value=True, disabled=True)
|
st.checkbox("Add source filename column", value=True, disabled=True)
|
||||||
|
|
||||||
st.divider()
|
st.divider()
|
||||||
st.button("Merge Files", type="primary", use_container_width=True, disabled=True)
|
st.button("Merge Files", type="primary", width="stretch", disabled=True)
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ if uploaded is not None:
|
|||||||
df = pd.read_csv(uploaded)
|
df = pd.read_csv(uploaded)
|
||||||
st.subheader(f"Preview: {uploaded.name}")
|
st.subheader(f"Preview: {uploaded.name}")
|
||||||
st.caption(f"{len(df)} rows, {len(df.columns)} columns")
|
st.caption(f"{len(df)} rows, {len(df.columns)} columns")
|
||||||
st.dataframe(df.head(10), use_container_width=True)
|
st.dataframe(df.head(10), width="stretch")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
from src.core.errors import format_for_user
|
from src.core.errors import format_for_user
|
||||||
st.error(
|
st.error(
|
||||||
@@ -100,5 +100,5 @@ st.subheader("Report Format")
|
|||||||
st.selectbox("Output format", ["Excel (flagged rows)", "PDF summary", "Both"], disabled=True)
|
st.selectbox("Output format", ["Excel (flagged rows)", "PDF summary", "Both"], disabled=True)
|
||||||
|
|
||||||
st.divider()
|
st.divider()
|
||||||
st.button("Validate & Generate Report", type="primary", use_container_width=True, disabled=True)
|
st.button("Validate & Generate Report", type="primary", width="stretch", disabled=True)
|
||||||
|
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ _has_result = st.session_state.get("pipeline_result") is not None
|
|||||||
|
|
||||||
with st.expander(f"Preview: {uploaded.name}", expanded=not _has_result):
|
with st.expander(f"Preview: {uploaded.name}", expanded=not _has_result):
|
||||||
st.caption(f"{len(df)} rows, {len(df.columns)} columns")
|
st.caption(f"{len(df)} rows, {len(df.columns)} columns")
|
||||||
st.dataframe(df.head(10), use_container_width=True)
|
st.dataframe(df.head(10), width="stretch")
|
||||||
|
|
||||||
st.divider()
|
st.divider()
|
||||||
|
|
||||||
@@ -170,7 +170,7 @@ with st.expander("Options", expanded=not _has_result):
|
|||||||
)
|
)
|
||||||
edited = st.data_editor(
|
edited = st.data_editor(
|
||||||
st.session_state["pipeline_rows"],
|
st.session_state["pipeline_rows"],
|
||||||
use_container_width=True,
|
width="stretch",
|
||||||
num_rows="dynamic",
|
num_rows="dynamic",
|
||||||
column_config={
|
column_config={
|
||||||
"tool": st.column_config.SelectboxColumn(
|
"tool": st.column_config.SelectboxColumn(
|
||||||
@@ -246,7 +246,7 @@ run_disabled = current_pipeline is None or not current_pipeline.steps
|
|||||||
if st.button(
|
if st.button(
|
||||||
"Run Pipeline",
|
"Run Pipeline",
|
||||||
type="primary",
|
type="primary",
|
||||||
use_container_width=True,
|
width="stretch",
|
||||||
disabled=run_disabled,
|
disabled=run_disabled,
|
||||||
):
|
):
|
||||||
progress = st.progress(0.0, text="Starting...")
|
progress = st.progress(0.0, text="Starting...")
|
||||||
@@ -343,10 +343,10 @@ step_df = pd.DataFrame([
|
|||||||
}
|
}
|
||||||
for sr in result.step_results
|
for sr in result.step_results
|
||||||
])
|
])
|
||||||
st.dataframe(step_df, use_container_width=True, hide_index=True)
|
st.dataframe(step_df, width="stretch", hide_index=True)
|
||||||
|
|
||||||
st.markdown("**Output preview (first 10 rows)**")
|
st.markdown("**Output preview (first 10 rows)**")
|
||||||
st.dataframe(result.final_df.head(10), use_container_width=True)
|
st.dataframe(result.final_df.head(10), width="stretch")
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Downloads
|
# Downloads
|
||||||
|
|||||||
Reference in New Issue
Block a user