Cherry-pick [2.7] pin fastdigest==0.4.0 due to API changes (#4217)#4291
Cherry-pick [2.7] pin fastdigest==0.4.0 due to API changes (#4217)#4291YuanTingHsieh wants to merge 2 commits intoNVIDIA:mainfrom
Conversation
Greptile SummaryThis PR pins Key changes:
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["pip install nvflare test"] --> B{"python_version < 3.14?"}
B -- Yes --> C["fastdigest==0.4.0 installed"]
B -- No --> D["fastdigest NOT installed"]
C --> E["Quantile tests pass on Linux CI"]
D --> F["Quantile tests fail on Python 3.14+"]
G["pip install nvflare test_mac"] --> H["fastdigest NOT in test_mac extras"]
H --> I["Quantile tests may fail on Mac CI"]
Last reviewed commit: 01bf045 |
|
|
||
| pip install fastdigest==0.4.0 | ||
|
|
||
| Newer ``fastdigest`` releases changed the TDigest API and are planned to be adopted in a later branch. |
There was a problem hiding this comment.
User-facing phrasing references internal branch concept
The phrase "planned to be adopted in a later branch" uses Git branching terminology that is internal to the project and may confuse end users. Consider replacing it with version-oriented language such as "a future release" to keep the documentation audience-appropriate.
| Newer ``fastdigest`` releases changed the TDigest API and are planned to be adopted in a later branch. | |
| Newer ``fastdigest`` releases changed the TDigest API and are planned to be adopted in a future release. |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Pull request overview
Pins fastdigest to a specific version for the 2.7 branch to avoid TDigest API drift, and updates user-facing docs/tutorials to consistently instruct fastdigest==0.4.0 for quantile workflows.
Changes:
- Add
fastdigest==0.4.0to thetestextras insetup.cfg. - Update multiple READMEs/docs/notebooks to explicitly pin
fastdigest==0.4.0for quantile examples. - Add a pinned-install snippet to the advanced federated-statistics README.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| setup.cfg | Pins fastdigest==0.4.0 under test extras to keep test envs on the older TDigest API. |
| examples/tutorials/.../federated_statistics_with_tabular_data.ipynb | Updates tutorial text to instruct installing fastdigest==0.4.0 for quantiles. |
| examples/hello-world/hello-tabular-stats/df_stats.ipynb | Updates notebook instructions to pin fastdigest==0.4.0. |
| examples/hello-world/hello-tabular-stats/README.md | Updates README to pin fastdigest==0.4.0. |
| examples/advanced/federated-statistics/df_stats/README.md | Adds explicit “install and pin” snippet for fastdigest==0.4.0. |
| docs/hello-world/hello-tabular-stats/index.rst | Updates docs to pin fastdigest==0.4.0. |
| docs/examples/federated_statistics_overview.rst | Adds guidance to pin fastdigest==0.4.0 and notes API changes in newer releases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "> **Installing fastdigest**\n", | ||
| ">\n", | ||
| "> If you intend to calculate quantiles, you need to install fastdigest. the fastdigest not included in the requirements.txt file. If you are not calculating quantiles, you can skip this step.\n", | ||
| "> If you intend to calculate quantiles, install `fastdigest==0.4.0`. the fastdigest not included in the requirements.txt file. If you are not calculating quantiles, you can skip this step.\n", |
There was a problem hiding this comment.
The updated sidebar sentence has grammatical issues (e.g., "the fastdigest not included") and double spacing after the period. Please revise to a complete, capitalized sentence (e.g., "fastdigest is not included in requirements.txt").
| "> If you intend to calculate quantiles, install `fastdigest==0.4.0`. the fastdigest not included in the requirements.txt file. If you are not calculating quantiles, you can skip this step.\n", | |
| "> If you intend to calculate quantiles, install `fastdigest==0.4.0`. The `fastdigest` package is not included in the `requirements.txt` file. If you are not calculating quantiles, you can skip this step.\n", |
## Summary - pin `fastdigest` to `0.4.0` in `setup.cfg` for `2.7` test environments - keep `2.7` on the existing TDigest API by reverting temporary compatibility-layer code changes in quantile runtime/tests - remove temporary user-facing example API additions so example/job interfaces remain unchanged - update docs/READMEs/tutorial notebooks to explicitly state `2.7` quantile workflows should use `fastdigest==0.4.0` ## Test plan - [x] `python -m py_compile nvflare/app_opt/statistics/df/df_core_statistics.py nvflare/app_opt/statistics/quantile_stats.py tests/unit_test/app_common/statistics/quantile_test.py` - [x] `python -m py_compile examples/advanced/federated-statistics/df_stats/client.py examples/advanced/federated-statistics/df_stats/job.py examples/hello-world/hello-tabular-stats/client.py examples/hello-world/hello-tabular-stats/job.py` - [ ] `pytest -q tests/unit_test/app_common/statistics/quantile_test.py` (blocked locally: current macOS env segfaults on `import numpy`) - [ ] Linux CI / non-mac validation for quantile tests with `fastdigest==0.4.0` ## Notes - This PR intentionally avoids user-facing API changes on `2.7`. - TDigest API migration for newer `fastdigest` versions will be handled later on `main`.
22593bd to
6756c09
Compare
Summary
fastdigestto0.4.0insetup.cfgfor2.7test environments2.7on the existing TDigest API by reverting temporary compatibility-layer code changes in quantile runtime/tests2.7quantile workflows should usefastdigest==0.4.0Test plan
python -m py_compile nvflare/app_opt/statistics/df/df_core_statistics.py nvflare/app_opt/statistics/quantile_stats.py tests/unit_test/app_common/statistics/quantile_test.pypython -m py_compile examples/advanced/federated-statistics/df_stats/client.py examples/advanced/federated-statistics/df_stats/job.py examples/hello-world/hello-tabular-stats/client.py examples/hello-world/hello-tabular-stats/job.pypytest -q tests/unit_test/app_common/statistics/quantile_test.py(blocked locally: current macOS env segfaults onimport numpy)fastdigest==0.4.0Notes
2.7.fastdigestversions will be handled later onmain.Fixes # .
Description
A few sentences describing the changes proposed in this pull request.
Types of changes
./runtest.sh.