Skip to content

remove mapreduce methods that don't take an iterator argument#54088

Merged
oscardssmith merged 1 commit intoJuliaLang:masterfrom
nsajko:iteratorless_mapreduce
Apr 26, 2024
Merged

remove mapreduce methods that don't take an iterator argument#54088
oscardssmith merged 1 commit intoJuliaLang:masterfrom
nsajko:iteratorless_mapreduce

Conversation

@nsajko
Copy link
Copy Markdown
Member

@nsajko nsajko commented Apr 15, 2024

PR #52631 made map throw MethodError when called without an iterator argument. That made mapreduce throw MethodError when called without an iterator argument, too, something that was not noticed back then. This change makes iteratorless mapreduce throw before it can be called, instead of when it tries to call map (or Generator) without passing it an iterator argument.

Now all of these functions should only have methods that take a positive number of iterator arguments, which improves consistency:

  1. map
  2. Iterators.map
  3. foreach
  4. reduce
  5. foldl
  6. foldr
  7. mapreduce
  8. mapfoldl
  9. mapfoldr
  10. Base.Generator

PR JuliaLang#52631 made `map` throw `MethodError` when called without an
iterator argument. That made `mapreduce` throw `MethodError` when
called without an iterator argument, too, something that was *not*
noticed back then. This change makes iteratorless `mapreduce` throw
before it can be called, instead of when it tries to call `map` (or
`Generator`) without passing it an iterator argument.

Now all of these functions should only have methods that take a
positive number of iterator arguments, which improves consistency:

1. `map`
2. `Iterators.map`
3. `foreach`
4. `reduce`
5. `foldl`
6. `foldr`
7. `mapreduce`
8. `mapfoldl`
9. `mapfoldr`
10. `Base.Generator`
@nsajko
Copy link
Copy Markdown
Member Author

nsajko commented Apr 15, 2024

Should probably also update the NEWS entry for v1.11. Should I just open a PR to the release-1.11 branch? Not sure what the procedure is.

@LilithHafner
Copy link
Copy Markdown
Member

I like this PR for all the same reasons as #52631.

The procedure for backporting is to make a PR to master and add a backport label.

@nanosoldier runtests()

@nanosoldier
Copy link
Copy Markdown
Collaborator

The package evaluation job you requested has completed - possible new issues were detected.
The full report is available.

@LilithHafner LilithHafner added triage This should be discussed on a triage call minor change Marginal behavior change acceptable for a minor release labels Apr 16, 2024
@LilithHafner
Copy link
Copy Markdown
Member

PkgEval looks clean. Tagging triage because this is technically breaking, but I expect this to be an easy "yes".

@LilithHafner
Copy link
Copy Markdown
Member

Triage has no objection to this

@LilithHafner LilithHafner removed the triage This should be discussed on a triage call label Apr 25, 2024
@nsajko
Copy link
Copy Markdown
Member Author

nsajko commented Apr 26, 2024

Is something missing here or is it good to go?

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

Labels

minor change Marginal behavior change acceptable for a minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants