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

Support passing just name and data_type to add_columns #3175

Open
wjones127 opened this issue Nov 25, 2024 · 0 comments
Open

Support passing just name and data_type to add_columns #3175

wjones127 opened this issue Nov 25, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@wjones127
Copy link
Contributor

If you just want to add a column, but not fill it in immediately, the API makes it possible, but it is awkward.

table.add_columns({"new_column": "cast(NULL as int64)"})

It would be nicer if a user could use

table.add_columns([pa.field("new_column", pa.int64())])

There's an upstream issue that would support this: #3044

We could also make a hacky implementation for now that does the conversion from a field to a cast(NULL as ____) expression.

@wjones127 wjones127 added the enhancement New feature or request label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant