Skip to content

fix: handle incomplete chart encodings, optional agent deps, and unsafe table loading - #20

Merged
cxxxxxn (cxxxxxn) merged 3 commits into
microsoft:mainfrom
cxxxxxn:pr-fixes
Jul 21, 2026
Merged

fix: handle incomplete chart encodings, optional agent deps, and unsafe table loading#20
cxxxxxn (cxxxxxn) merged 3 commits into
microsoft:mainfrom
cxxxxxn:pr-fixes

Conversation

@cxxxxxn

Copy link
Copy Markdown
Collaborator

Fixes #13.
Fixes #18.
Fixes #19.

Changes

  • fix: remove dynamic exec from table loading — avoid unsafe dynamic execution when loading tables.
  • fix: declare optional agent dependencies — mark agent-related packages as optional extras.
  • fix: handle incomplete chart encodings — gracefully handle charts with missing/partial encodings.

Rebased onto the latest main.

Copilot AI 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.

Pull request overview

Fixes several robustness and packaging issues across VisEval: it hardens order_check against incomplete chart encodings (preventing KeyErrors), makes agent dependencies optional via extras, and removes unsafe dynamic execution from agent table loading.

Changes:

  • Prevent duplicate invocation of order_check() in legality evaluation and add defensive checks for missing encoding/scale/mapping in order_check.
  • Replace exec-based table loading in CoML4VIS with direct pd.read_csv + describe_variable and add tests.
  • Add an [agents] optional dependency group and update docs/imports to avoid requiring agent deps by default.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
viseval/evaluate.py Removes redundant order_check call during legality checking.
viseval/check/order_check.py Adds guards for missing/partial encodings to avoid KeyErrors.
tests/test_order_check.py Adds regression tests for incomplete chart info handling.
tests/test_coml4vis.py Adds test ensuring read_table() no longer uses dynamic execution.
README.md Documents installing optional agent dependencies via extras.
pyproject.toml Introduces [project.optional-dependencies].agents and pins langchain.
examples/evaluate.py Lazily imports agents to avoid import-time optional dependency failures.
examples/agent/coml4vis.py Removes exec in read_table() and constructs variable descriptions directly.
examples/agent/__init__.py Switches to lazy imports for agents via __getattr__.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread examples/agent/__init__.py
Comment thread examples/agent/__init__.py Outdated
Comment on lines +15 to +19
def __getattr__(name):
if name not in _AGENT_MODULES:
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
module = import_module(_AGENT_MODULES[name], __name__)
return getattr(module, name)
Comment thread examples/agent/coml4vis.py Outdated
@cxxxxxn
cxxxxxn (cxxxxxn) merged commit e31f904 into microsoft:main Jul 21, 2026
4 checks passed
@cxxxxxn
cxxxxxn (cxxxxxn) deleted the pr-fixes branch July 21, 2026 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants