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

refactor(api): rename to_* methods for type coercion to something else #9788

Closed
Tracked by #9638
jcrist opened this issue Aug 7, 2024 · 0 comments · Fixed by #9843
Closed
Tracked by #9638

refactor(api): rename to_* methods for type coercion to something else #9788

jcrist opened this issue Aug 7, 2024 · 0 comments · Fixed by #9843
Labels
refactor Issues or PRs related to refactoring the codebase ux User experience related issues
Milestone

Comments

@jcrist
Copy link
Member

jcrist commented Aug 7, 2024

Currently ibis has several to_* methods - some compute and return a result (to_pandas, to_polars, to_parquet, ...), while others are for type coercion and continue to build up an expression (to_timestamp, to_interval, ...).

I think we should rename the latter methods (with a deprecation period), keeping the to_* prefix for things that compute and return a result.

The current list is:

IntegerValue.to_timestamp(self, unit)
IntegerValue.to_interval(self, unit)

StringValue.to_timestamp(self, format_str)
StringValue.to_date(self, format_str)

IntervalValue.to_unit(self, target_unit)

A few options:

  • Use as_* prefixes instead. This is what we did for the geospatial API (e.g. as_ewkb, as_binary, ...)
  • Use a more specific verb like parse_* for the string ones?
  • ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Issues or PRs related to refactoring the codebase ux User experience related issues
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants
@jcrist and others