Skip to content

fix: guard optional SparkLLM dependency to prevent pytest collection failure#1980

Open
mo2g wants to merge 8 commits intoFoundationAgents:mainfrom
mo2g:fix/ci-workflows
Open

fix: guard optional SparkLLM dependency to prevent pytest collection failure#1980
mo2g wants to merge 8 commits intoFoundationAgents:mainfrom
mo2g:fix/ci-workflows

Conversation

@mo2g
Copy link
Copy Markdown
Contributor

@mo2g mo2g commented Mar 24, 2026

Features

  • Fix pytest collection failure caused by hard importing SparkLLM when optional dependency sparkai is unavailable.
  • Make Spark-related modules degrade gracefully in environments without sparkai, so Full Tests can proceed in CI.
  • Keep the existing workflow improvements, but scope this PR mainly to repository code / dependency robustness instead of CI syntax only.

Feature Docs

N/A

Influence

  • Affects test collection behavior in CI and local environments without sparkai.
  • Reduces coupling between optional LLM provider integrations and the default test path.
  • Helps Full Tests run successfully on clean environments where Spark-related dependencies are not installed.

Result

  • Before this change, pytest exited during collection with code 4 because SparkLLM was imported unconditionally and sparkai was missing in CI.
  • After this change, pytest no longer fails at collection time due to the optional Spark dependency, and Full Tests can continue to actual test execution.

Other

  • This PR fixes a repository code / optional dependency handling issue, not just an outdated workflow configuration issue.
  • Spark-related functionality still requires installing the corresponding optional dependency in actual usage.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant