apache / apache/arrow

[Python] Chained projections

Open
#36,665 3 comments 0 reactions 0 assignees View on GitHub
Component: Python Type: enhancement
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 13h
Merged PRs (30d)
88

Description

### Describe the enhancement requested

Hi Arrow Team,

I'd like to be able to chain projections - by which I mean something like this:
With a dataset that has schema `food: string, cost: int64`:
```
dataset = dataset.project({ "food": ds.field("food"), "costPlusOne": ds.field("cost") + 1 })
.project({ "food": ds.field("food"), "costPlusTwo": ds.field("costPlusOne") + 1 })
```

Note the chaining of the cost properties. I don't believe this is possible atm from Python(?)

Thanks

### Component(s)

Python

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.