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

feat(api): support deferred objects in literal #9904

Merged
merged 1 commit into from
Aug 24, 2024

Conversation

cpcloud
Copy link
Member

@cpcloud cpcloud commented Aug 22, 2024

Allow passing deferred inputs to literal.

@cpcloud cpcloud added this to the 9.4 milestone Aug 22, 2024
@cpcloud cpcloud added the feature Features or general enhancements label Aug 22, 2024
@cpcloud cpcloud requested a review from jcrist August 22, 2024 21:41
@cpcloud cpcloud force-pushed the deferred-literal branch 3 times, most recently from e221216 to aedb65a Compare August 22, 2024 22:04
Copy link
Contributor

@ncclementi ncclementi left a comment

Choose a reason for hiding this comment

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

Is there a place in the docs, where we could add an example of this? I'm trying to think of how would one would use it and why.

We have this https://ibis-project.org/how-to/analytics/chain_expressions but I'm not sure it is the right place

@cpcloud
Copy link
Member Author

cpcloud commented Aug 23, 2024

Sure, coming right up.

Copy link
Member

@jcrist jcrist left a comment

Choose a reason for hiding this comment

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

Seems harmless. The reason we didn't support this before is that ibis.literal doesn't take an expression for any input type. The use case of using deferred in the selectors API to get non-expression values never occurred to me. Not a common use case, but easy enough to support.

ibis/expr/types/generic.py Outdated Show resolved Hide resolved
@cpcloud cpcloud enabled auto-merge (squash) August 24, 2024 12:31
@cpcloud cpcloud merged commit 0a07906 into ibis-project:main Aug 24, 2024
81 checks passed
@cpcloud cpcloud deleted the deferred-literal branch August 24, 2024 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Features or general enhancements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants