Commit 7af7ace
Fix misleading add_column() usage example in docstring (#7648)
* Fix misleading add_column() usage example in docstring
This PR fixes the usage example in the Dataset.add_column() docstring, which previously implied that add_column() modifies the dataset in-place.
Why:
The method returns a new dataset with the additional column, and users must assign the result to a variable to preserve the change.
Fixes #7611
* Fix misleading docstring examples for select_columns, select, filter, shard, and flatten
Fix misleading docstring examples for select_columns, select, filter, shard, and flatten
- Updated usage examples to show correct behavior (methods return new datasets)
- Added inline comments to clarify that methods do not modify in-place
- Fixes follow-up from issue #7611 and @lhoestq’s review on PR #7648
* Apply suggestions from code review
---------
Co-authored-by: Quentin Lhoest <[email protected]>1 parent 9dfa288 commit 7af7ace
1 file changed
+13
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2041 | 2041 | | |
2042 | 2042 | | |
2043 | 2043 | | |
2044 | | - | |
| 2044 | + | |
| 2045 | + | |
2045 | 2046 | | |
2046 | 2047 | | |
2047 | 2048 | | |
| |||
2399 | 2400 | | |
2400 | 2401 | | |
2401 | 2402 | | |
2402 | | - | |
| 2403 | + | |
| 2404 | + | |
2403 | 2405 | | |
2404 | 2406 | | |
2405 | 2407 | | |
| |||
3869 | 3871 | | |
3870 | 3872 | | |
3871 | 3873 | | |
3872 | | - | |
| 3874 | + | |
| 3875 | + | |
3873 | 3876 | | |
3874 | 3877 | | |
3875 | 3878 | | |
3876 | 3879 | | |
3877 | 3880 | | |
| 3881 | + | |
3878 | 3882 | | |
3879 | 3883 | | |
3880 | 3884 | | |
| |||
4041 | 4045 | | |
4042 | 4046 | | |
4043 | 4047 | | |
4044 | | - | |
| 4048 | + | |
| 4049 | + | |
4045 | 4050 | | |
4046 | 4051 | | |
4047 | 4052 | | |
| |||
4936 | 4941 | | |
4937 | 4942 | | |
4938 | 4943 | | |
4939 | | - | |
| 4944 | + | |
| 4945 | + | |
4940 | 4946 | | |
4941 | 4947 | | |
4942 | 4948 | | |
| |||
6005 | 6011 | | |
6006 | 6012 | | |
6007 | 6013 | | |
6008 | | - | |
| 6014 | + | |
| 6015 | + | |
6009 | 6016 | | |
6010 | 6017 | | |
6011 | 6018 | | |
| |||
0 commit comments