Skip to content

Fix custom exceptions to preserve messages#695

Open
drbenvincent wants to merge 1 commit intomainfrom
codex/issue-665-custom-exceptions
Open

Fix custom exceptions to preserve messages#695
drbenvincent wants to merge 1 commit intomainfrom
codex/issue-665-custom-exceptions

Conversation

@drbenvincent
Copy link
Collaborator

Summary

  • Call super().__init__(message) in custom exceptions while preserving self.message.
  • Add regression tests for exception string rendering.

Testing

  • conda run -n CausalPy python -m pytest (fails: PyTensor compiledir permission error)
  • PYTENSOR_FLAGS="compiledir=/tmp/pytensor" conda run -n CausalPy python -m pytest (timed out at 120s)

Closes #665

@drbenvincent drbenvincent marked this pull request as draft February 2, 2026 21:28
@read-the-docs-community
Copy link

Documentation build overview

📚 causalpy | 🛠️ Build #31244666 | 📁 Comparing b08240e against latest (2cf6d3a)


🔍 Preview build

Show files changed (23 files in total): 📝 23 modified | ➕ 0 added | ➖ 0 deleted
File Status
404.html 📝 modified
api/generated/causalpy.pymc_models.BayesianBasisExpansionTimeSeries.calculate_cumulative_impact.html 📝 modified
api/generated/causalpy.pymc_models.BayesianBasisExpansionTimeSeries.priors_from_data.html 📝 modified
api/generated/causalpy.pymc_models.InstrumentalVariableRegression.calculate_cumulative_impact.html 📝 modified
api/generated/causalpy.pymc_models.InstrumentalVariableRegression.predict.html 📝 modified
api/generated/causalpy.pymc_models.InstrumentalVariableRegression.priors_from_data.html 📝 modified
api/generated/causalpy.pymc_models.LinearRegression.build_model.html 📝 modified
api/generated/causalpy.pymc_models.LinearRegression.calculate_cumulative_impact.html 📝 modified
api/generated/causalpy.pymc_models.LinearRegression.predict.html 📝 modified
api/generated/causalpy.pymc_models.LinearRegression.priors_from_data.html 📝 modified
api/generated/causalpy.pymc_models.PropensityScore.calculate_cumulative_impact.html 📝 modified
api/generated/causalpy.pymc_models.PropensityScore.predict.html 📝 modified
api/generated/causalpy.pymc_models.PropensityScore.priors_from_data.html 📝 modified
api/generated/causalpy.pymc_models.PyMCModel.build_model.html 📝 modified
api/generated/causalpy.pymc_models.PyMCModel.calculate_cumulative_impact.html 📝 modified
api/generated/causalpy.pymc_models.PyMCModel.predict.html 📝 modified
api/generated/causalpy.pymc_models.PyMCModel.priors_from_data.html 📝 modified
api/generated/causalpy.pymc_models.StateSpaceTimeSeries.calculate_cumulative_impact.html 📝 modified
api/generated/causalpy.pymc_models.StateSpaceTimeSeries.priors_from_data.html 📝 modified
api/generated/causalpy.pymc_models.WeightedSumFitter.build_model.html 📝 modified
api/generated/causalpy.pymc_models.WeightedSumFitter.calculate_cumulative_impact.html 📝 modified
api/generated/causalpy.pymc_models.WeightedSumFitter.predict.html 📝 modified
api/generated/causalpy.pymc_models.WeightedSumFitter.priors_from_data.html 📝 modified

@github-actions github-actions bot added the bug Something isn't working label Feb 9, 2026
@codecov
Copy link

codecov bot commented Feb 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.36%. Comparing base (2cf6d3a) to head (b08240e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #695   +/-   ##
=======================================
  Coverage   94.35%   94.36%           
=======================================
  Files          44       45    +1     
  Lines        7517     7527   +10     
  Branches      456      456           
=======================================
+ Hits         7093     7103   +10     
  Misses        262      262           
  Partials      162      162           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@drbenvincent drbenvincent marked this pull request as ready for review February 9, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom exceptions drop message without super().__init__

1 participant