Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(common): do not convert callables to resolveable objects #7956

Merged

Conversation

kszucs
Copy link
Member

@kszucs kszucs commented Jan 11, 2024

Fixes #7626.

@kszucs kszucs force-pushed the deferred-factory-underscore-positional branch from 88d115b to 5af4921 Compare January 11, 2024 11:40
@kszucs kszucs changed the title fix(common): pass _ as positional argument to user provided deferred functions fix(common): do not convert callables to resolveable objects Jan 11, 2024
@kszucs kszucs force-pushed the deferred-factory-underscore-positional branch from 5af4921 to 6bb8cc1 Compare January 11, 2024 12:15
@kszucs kszucs requested a review from cpcloud January 11, 2024 12:15
@cpcloud
Copy link
Member

cpcloud commented Jan 11, 2024

I this fixes #7626.

Can you give that a try?

@cpcloud cpcloud added bug Incorrect behavior inside of ibis ux User experience related issues labels Jan 11, 2024
@cpcloud cpcloud added this to the 8.0 milestone Jan 11, 2024
@cpcloud
Copy link
Member

cpcloud commented Jan 11, 2024

Confirmed that this PR fixes #7626:

In [1]: import ibis
   ...: from ibis import _
   ...:
   ...: ibis.options.interactive = True
   ...:
   ...: t = ibis.memtable({"x": [[1, 2, 3]]})
   ...: t.mutate(t.x.filter(lambda y: y == 2))  # works
   ...: t.mutate(t.x.map(lambda y: y + 1))  # works
   ...: t.mutate(_.x.filter(lambda y: y == 2))  # error
   ...: t.mutate(_.x.map(lambda y: y + 1))  # error
Out[1]:
┏━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ x                    ┃ ArrayMap(x, Add(y, 1)) ┃
┡━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━┩
│ array<int64>         │ array<int64>           │
├──────────────────────┼────────────────────────┤
│ [1, 2, ... +1]       │ [2, 3, ... +1]         │
└──────────────────────┴────────────────────────┘

image

@cpcloud cpcloud linked an issue Jan 11, 2024 that may be closed by this pull request
1 task
Copy link
Member

@cpcloud cpcloud left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@cpcloud cpcloud merged commit 9963705 into ibis-project:main Jan 11, 2024
83 checks passed
@kszucs kszucs deleted the deferred-factory-underscore-positional branch January 11, 2024 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior inside of ibis ux User experience related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: can't use ArrayValue.filter() and friends with Deferreds
2 participants