Skip to content

Refactor data loading and chatbot into modules - #1

Open
ardiannurcahya wants to merge 1 commit into
mainfrom
codex/refactor-dataset-upload-logic-to-data_loader.py
Open

Refactor data loading and chatbot into modules#1
ardiannurcahya wants to merge 1 commit into
mainfrom
codex/refactor-dataset-upload-logic-to-data_loader.py

Conversation

@ardiannurcahya

@ardiannurcahya ardiannurcahya commented Sep 18, 2025

Copy link
Copy Markdown
Owner

Summary

  • Move CSV upload and merge logic into data_loader.load_files and merge_dataframes for reuse
  • Extract chatbot session and query handling into chatbot.init_state and handle_user_query
  • Simplify app.py to import new modules and orchestrate Streamlit layout

Testing

  • python -m py_compile app.py chatbot.py data_loader.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 馃憤.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment thread app.py
Comment on lines +6 to +10
from data_loader import load_files, merge_dataframes
from chatbot import init_state, handle_user_query
from prompt_models import generate_prompt
from execution_programs import execute_code, add_to_history
from llm_models import code_llm

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P0] Import display_history from execution_programs

The refactor replaced the wildcard import of execution_programs with explicit imports but only brought in execute_code and add_to_history. The script still calls display_history() at the end of the Streamlit layout, so the app now raises NameError: name 'display_history' is not defined as soon as the page renders. Add display_history to the imports to keep the app runnable.

Useful? React with 馃憤聽/ 馃憥.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant