dmlc / treelite

Universal model exchange and serialization format for decision tree forests
https://treelite.readthedocs.io/en/latest/
Apache License 2.0
730 stars 98 forks source link

Add warning when loading from newer minor version #450

Closed hcho3 closed 1 year ago

hcho3 commented 1 year ago

Also propagate C++ warnings as Python warnings too.

Closes https://github.com/triton-inference-server/fil_backend/issues/288 Closes https://github.com/dmlc/treelite/issues/441

Example of warning:

C:\Users\noble\Desktop\workspace\treelite\python\treelite\util.py:62: UserWarning:
    [21:54:54] C:\Users\noble\Desktop\workspace\treelite\src\c_api\c_api.cc:121:
    TreeliteLoadLightGBMModel() is deprecated. Please use TreeliteLoadLightGBMModelEx() instead.
codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 81.25% and project coverage change: -0.74 :warning:

Comparison is base (c217490) 85.30% compared to head (0c28750) 84.57%.

:exclamation: Current head 0c28750 differs from pull request most recent head 57dcd7f. Consider uploading reports for the commit 57dcd7f to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## mainline #450 +/- ## ============================================== - Coverage 85.30% 84.57% -0.74% - Complexity 42 44 +2 ============================================== Files 112 110 -2 Lines 9446 8454 -992 Branches 599 40 -559 ============================================== - Hits 8058 7150 -908 + Misses 1365 1280 -85 - Partials 23 24 +1 ``` | [Impacted Files](https://codecov.io/gh/dmlc/treelite/pull/450?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dmlc) | Coverage Δ | | |---|---|---| | [include/treelite/tree\_impl.h](https://codecov.io/gh/dmlc/treelite/pull/450?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dmlc#diff-aW5jbHVkZS90cmVlbGl0ZS90cmVlX2ltcGwuaA==) | `87.37% <12.50%> (-0.35%)` | :arrow_down: | | [python/treelite/util.py](https://codecov.io/gh/dmlc/treelite/pull/450?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dmlc#diff-cHl0aG9uL3RyZWVsaXRlL3V0aWwucHk=) | `82.85% <80.00%> (-1.02%)` | :arrow_down: | | [python/treelite/core.py](https://codecov.io/gh/dmlc/treelite/pull/450?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dmlc#diff-cHl0aG9uL3RyZWVsaXRlL2NvcmUucHk=) | `77.41% <83.33%> (-4.73%)` | :arrow_down: | | [include/treelite/logging.h](https://codecov.io/gh/dmlc/treelite/pull/450?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dmlc#diff-aW5jbHVkZS90cmVlbGl0ZS9sb2dnaW5nLmg=) | `100.00% <100.00%> (ø)` | | | [src/c\_api/c\_api\_common.cc](https://codecov.io/gh/dmlc/treelite/pull/450?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dmlc#diff-c3JjL2NfYXBpL2NfYXBpX2NvbW1vbi5jYw==) | `100.00% <100.00%> (ø)` | | | [src/logging.cc](https://codecov.io/gh/dmlc/treelite/pull/450?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dmlc#diff-c3JjL2xvZ2dpbmcuY2M=) | `100.00% <100.00%> (ø)` | | ... and [64 files with indirect coverage changes](https://codecov.io/gh/dmlc/treelite/pull/450/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dmlc) Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dmlc). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dmlc)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.