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

Fix documentation builds with pandas 2 changes #14937

Merged
merged 19 commits into from
Jan 30, 2024

Conversation

vyasr
Copy link
Contributor

@vyasr vyasr commented Jan 30, 2024

Description

The changes to the Index hierarchy cudf that we made for pandas 2 compatibility (removing GenericIndex and having all single-columned indexes inherit directly from Index, which in turn now inherits from SingleColumnFrame, and therefore inherits from Frame) means that Index itself now inherits methods from Frame. Many of those methods should not be defined on Index types. This PR moves those definitions to IndexedFrame to avoid these problems.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@vyasr vyasr added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Jan 30, 2024
@vyasr vyasr self-assigned this Jan 30, 2024
@vyasr vyasr requested a review from a team as a code owner January 30, 2024 18:54
@vyasr vyasr requested review from wence- and isVoid and removed request for a team January 30, 2024 18:54
@github-actions github-actions bot added the Python Affects Python cuDF API. label Jan 30, 2024
Copy link
Contributor

@bdice bdice Jan 30, 2024

Choose a reason for hiding this comment

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

Here is a diff of (documented) Index APIs between cudf (<) and pandas (>). We should make sure we deprecate/drop anything in cudf that was in pandas 1 but deprecated/dropped from pandas 2.

Only in cudf:
< DatetimeIndex.isocalendar
< Index.deserialize
< Index.device_deserialize
< Index.device_serialize
< Index.find_label_range
< Index.from_arrow
< Index.from_pandas
< Index.host_deserialize
< Index.host_serialize
< Index.isnull
< Index.nlevels
< Index.notnull
< Index.serialize
< Index.str
< Index.to_arrow
< Index.to_cupy
< Index.to_dlpack
< Index.to_numpy
< Index.to_pandas
< Index.tolist
< MultiIndex.from_arrow
< RangeIndex.to_arrow
< RangeIndex.to_numpy

Only in pandas 2:
> CategoricalIndex.add_categories
> CategoricalIndex.as_ordered
> CategoricalIndex.as_unordered
> CategoricalIndex.map
> CategoricalIndex.ordered
> CategoricalIndex.remove_categories
> CategoricalIndex.remove_unused_categories
> CategoricalIndex.rename_categories
> CategoricalIndex.reorder_categories
> CategoricalIndex.set_categories
> DatetimeIndex.as_unit
> DatetimeIndex.date
> DatetimeIndex.day_name
> DatetimeIndex.day_of_week
> DatetimeIndex.freq
> DatetimeIndex.freqstr
> DatetimeIndex.indexer_at_time
> DatetimeIndex.indexer_between_time
> DatetimeIndex.inferred_freq
> DatetimeIndex.is_month_end
> DatetimeIndex.is_month_start
> DatetimeIndex.is_quarter_end
> DatetimeIndex.is_quarter_start
> DatetimeIndex.is_year_end
> DatetimeIndex.is_year_start
> DatetimeIndex.mean
> DatetimeIndex.month_name
> DatetimeIndex.normalize
> DatetimeIndex.snap
> DatetimeIndex.std
> DatetimeIndex.strftime
> DatetimeIndex.time
> DatetimeIndex.timetz
> DatetimeIndex.to_period
> DatetimeIndex.to_pydatetime
> DatetimeIndex.tz
> Index.T
> Index.argmax
> Index.argmin
> Index.asof
> Index.asof_locs
> Index.delete
> Index.drop
> Index.droplevel
> Index.get_indexer_for
> Index.get_indexer_non_unique
> Index.identical
> Index.inferred_type
> Index.insert
> Index.is_
> Index.item
> Index.map
> Index.nbytes
> Index.putmask
> Index.ravel
> Index.reindex
> Index.slice_indexer
> Index.slice_locs
> Index.symmetric_difference
> Index.value_counts
> Index.view
> IndexSlice
> IntervalIndex.closed
> IntervalIndex.contains
> IntervalIndex.from_arrays
> IntervalIndex.from_tuples
> IntervalIndex.is_empty
> IntervalIndex.is_non_overlapping_monotonic
> IntervalIndex.is_overlapping
> IntervalIndex.left
> IntervalIndex.length
> IntervalIndex.mid
> IntervalIndex.overlaps
> IntervalIndex.right
> IntervalIndex.set_closed
> IntervalIndex.to_tuples
> MultiIndex.append
> MultiIndex.copy
> MultiIndex.drop
> MultiIndex.dtypes
> MultiIndex.get_loc_level
> MultiIndex.get_locs
> MultiIndex.levshape
> MultiIndex.remove_unused_levels
> MultiIndex.reorder_levels
> MultiIndex.set_codes
> MultiIndex.set_levels
> MultiIndex.sortlevel
> MultiIndex.to_flat_index
> MultiIndex.truncate
> PeriodIndex
> PeriodIndex.asfreq
> PeriodIndex.day
> PeriodIndex.day_of_week
> PeriodIndex.day_of_year
> PeriodIndex.dayofweek
> PeriodIndex.dayofyear
> PeriodIndex.days_in_month
> PeriodIndex.daysinmonth
> PeriodIndex.end_time
> PeriodIndex.freq
> PeriodIndex.freqstr
> PeriodIndex.from_fields
> PeriodIndex.from_ordinals
> PeriodIndex.hour
> PeriodIndex.is_leap_year
> PeriodIndex.minute
> PeriodIndex.month
> PeriodIndex.quarter
> PeriodIndex.qyear
> PeriodIndex.second
> PeriodIndex.start_time
> PeriodIndex.strftime
> PeriodIndex.to_timestamp
> PeriodIndex.week
> PeriodIndex.weekday
> PeriodIndex.weekofyear
> PeriodIndex.year
> RangeIndex.from_range
> TimedeltaIndex.as_unit
> TimedeltaIndex.ceil
> TimedeltaIndex.floor
> TimedeltaIndex.mean
> TimedeltaIndex.round
> TimedeltaIndex.to_pytimedelta

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's handle these in a follow-up PR. We''ll need to look case-by-case since many if not most of these are likely real differences (cudf features pandas doesn't have or pandas features cudf doesn't have).

@vyasr vyasr merged commit f281b90 into rapidsai:pandas_2.0_feature_branch Jan 30, 2024
6 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants