Skip to content

Conversation

@Fokko
Copy link
Contributor

@Fokko Fokko commented Feb 24, 2025

Now we have the syntactic sugar (#1697), we don't need Lambda's anymore and can use the operator.{and_,or_} functions.

Also, the reduce is okay with just having a single argument, while And(*[EqualTo('a', 22)]) would fail.

python3
Python 3.10.14 (main, Mar 19 2024, 21:46:16) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import functools
>>> functools.reduce(lambda a, b: a + b, [1])
1
>>> functools.reduce(lambda a, b: a + b, [1, 2])
3

@Fokko Fokko force-pushed the fd-align-codestyle branch 2 times, most recently from 03b0ecd to 61cdf9f Compare February 24, 2025 08:36
@Fokko Fokko force-pushed the fd-align-codestyle branch from 61cdf9f to 7d030bc Compare February 24, 2025 08:52
Copy link
Contributor

@kevinjqliu kevinjqliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kevinjqliu kevinjqliu merged commit 6388b4d into apache:main Feb 24, 2025
7 checks passed
@Fokko Fokko deleted the fd-align-codestyle branch February 24, 2025 16:48
gabeiglio pushed a commit to Netflix/iceberg-python that referenced this pull request Aug 13, 2025
Now we have the syntactic sugar
(apache#1697), we don't need
Lambda's anymore and can use the `operator.{and_,or_}` functions.

Also, the reduce is okay with just having a single argument, while
`And(*[EqualTo('a', 22)])` would fail.
```
python3
Python 3.10.14 (main, Mar 19 2024, 21:46:16) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import functools
>>> functools.reduce(lambda a, b: a + b, [1])
1
>>> functools.reduce(lambda a, b: a + b, [1, 2])
3
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants