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

Consistently prefix (_?)with_ for "this, but with x changed" #2248

Open
1 task
dangotbanned opened this issue Mar 19, 2025 · 2 comments
Open
1 task

Consistently prefix (_?)with_ for "this, but with x changed" #2248

dangotbanned opened this issue Mar 19, 2025 · 2 comments

Comments

@dangotbanned
Copy link
Member

dangotbanned commented Mar 19, 2025

Originally posted by @dangotbanned in #2232 (comment)

this is fine - I guess we could call it _with_version for consistency with how we're now naming similar methods?

@MarcoGorelli Yeah I like that
I think we should open an issue to identify all the places we could change to that style.

I had a similar thought here - but reverted to keep the PR from spiraling:

Candidates

Important

  • Just for internal API
  • from_ becomes reserved for @classmethod(s)
Current Proposed
Compliant*._change_version() Compliant*._with_version()
Compliant(Data|Lazy)Frame._from_native_frame() Compliant*._with_native()
CompliantSeries._from_native_series() Same as above
(Dask|DuckDB|SparkLike)Expr._from_call() LazyExpr._with_callable()
Expr._from_callable() Expr._with_callable()
(Dask|DuckDB|SparkLike)ExprNameNamespace._from_alias_output_names() LazyExprNameNamespace._with_alias_output_names()

Related

@dangotbanned dangotbanned changed the title [internal]: Consistently use with_ prefix for "this, but with x" methods Consistently prefix (_?)with_ for "this, but with x changed" Mar 19, 2025
@dangotbanned
Copy link
Member Author

Someone please come up with a better title for this 😄

@dangotbanned
Copy link
Member Author

@MarcoGorelli I think I've found all the maybe withs 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant