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

[python] Enable chaining on certain write methods #123

Merged
merged 1 commit into from
Feb 13, 2023

Conversation

thetorpedodog
Copy link
Contributor

Returns self from a few methods to enable chaining:

  • DataFrame/DenseNDArray/SparseNDArray.write
  • Collection.set

This enables useful chaining:

some_coll.set('x', ...).set('y', ...)

my_df = DataFrame.create(...).write(...)
do_stuff_with(my_df)

I remember this being something we discussed a while back that got lost in other things, so here it is back again.

Copy link
Member

@bkmartinjr bkmartinjr left a comment

Choose a reason for hiding this comment

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

Very much in favor. Thanks!

Returns `self` from a few methods to enable chaining:

- DataFrame/DenseNDArray/SparseNDArray.write
- Collection.set

This enables useful chaining:

    some_coll.set('x', ...).set('y', ...)

    my_df = DataFrame.create(...).write(...)
    do_stuff_with(my_df)
@thetorpedodog thetorpedodog merged commit b010bb4 into main Feb 13, 2023
@thetorpedodog thetorpedodog deleted the chain-chain-chain branch February 13, 2023 17:03
@johnkerl johnkerl changed the title [python] Enable chaining on certain write methods. [python] Enable chaining on certain write methods Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants