apache / apache/datafusion-python

Add wrapper classes for Expression types

Open
#1,681 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
604
Forks
174
Avg merge
1d 7h
Merged PRs (30d)
4

Description

**Is your feature request related to a problem or challenge? Please describe what you are trying to do.**

As part of the discussion in https://github.com/apache/datafusion-python/pull/1674 we found a user wants access to some of the elements within an expression. In this case, `Limit`. If there is a growing base of users who want to use `datafusion-python` to do things such as analyzing the plans and using the data in them, then we should probably add wrapper classes for each of the Expressions.

**Describe the solution you'd like**

Right now we have the expressions like `Limit` available in `datafusion.expr` reexported like

```python
Limit = expr_internal.Limit
```

Instead we could have a `datafusion.expr` module that contains

```python
class Limit(Expr):
```

which has attributes to get `fetch` and `skip`.

**Describe alternatives you've considered**

We could leave as is and continue to expose data members as requested.

**Additional context**

This is a follow on to https://github.com/apache/datafusion-python/issues/1673

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the current datafusion.expr exports, especially the expr_internal.Limit re-export, then read PR #1674 and issue #1673 for the motivating use case. Define the wrapper scope from the existing Expression types; the work is done when the intended wrappers expose the requested expression data, including Limit.fetch and Limit.skip.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.