1414
1515from __future__ import annotations
1616
17- from typing import cast , Hashable , Iterable , Optional , Sequence , TYPE_CHECKING
17+ from typing import cast , Hashable , Iterable , Sequence
1818
1919import bigframes_vendored .pandas .core .indexes .multi as vendored_pandas_multindex
2020import pandas
2323from bigframes .core import expression as ex
2424from bigframes .core .indexes .base import Index
2525
26- if TYPE_CHECKING :
27- import bigframes .session
28-
2926
3027class MultiIndex (Index , vendored_pandas_multindex .MultiIndex ):
3128 __doc__ = vendored_pandas_multindex .MultiIndex .__doc__
@@ -36,25 +33,21 @@ def from_tuples(
3633 tuples : Iterable [tuple [Hashable , ...]],
3734 sortorder : int | None = None ,
3835 names : Sequence [Hashable ] | Hashable | None = None ,
39- * ,
40- session : Optional [bigframes .session .Session ] = None ,
4136 ) -> MultiIndex :
4237 pd_index = pandas .MultiIndex .from_tuples (tuples , sortorder , names )
4338 # Index.__new__ should detect multiple levels and properly create a multiindex
44- return cast (MultiIndex , Index (pd_index , session = session ))
39+ return cast (MultiIndex , Index (pd_index ))
4540
4641 @classmethod
4742 def from_arrays (
4843 cls ,
4944 arrays ,
5045 sortorder : int | None = None ,
5146 names = None ,
52- * ,
53- session : Optional [bigframes .session .Session ] = None ,
5447 ) -> MultiIndex :
5548 pd_index = pandas .MultiIndex .from_arrays (arrays , sortorder , names )
5649 # Index.__new__ should detect multiple levels and properly create a multiindex
57- return cast (MultiIndex , Index (pd_index , session = session ))
50+ return cast (MultiIndex , Index (pd_index ))
5851
5952 def __eq__ (self , other ) -> Index : # type: ignore
6053 import bigframes .operations as ops
@@ -78,38 +71,3 @@ def __eq__(self, other) -> Index: # type: ignore
7871 index_labels = [None ],
7972 )
8073 )
81-
82-
83- class MultiIndexAccessor :
84- """Proxy to MultiIndex constructors to allow a session to be passed in."""
85-
86- def __init__ (self , session : bigframes .session .Session ):
87- self ._session = session
88-
89- def __call__ (self , * args , ** kwargs ) -> MultiIndex :
90- """Construct a MultiIndex using the associated Session.
91-
92- See :class:`bigframes.pandas.MultiIndex`.
93- """
94- return MultiIndex (* args , session = self ._session , ** kwargs )
95-
96- def from_arrays (self , * args , ** kwargs ) -> MultiIndex :
97- """Construct a MultiIndex using the associated Session.
98-
99- See :func:`bigframes.pandas.MultiIndex.from_arrays`.
100- """
101- return MultiIndex .from_arrays (* args , session = self ._session , ** kwargs )
102-
103- def from_frame (self , * args , ** kwargs ) -> MultiIndex :
104- """Construct a MultiIndex using the associated Session.
105-
106- See :func:`bigframes.pandas.MultiIndex.from_frame`.
107- """
108- return cast (MultiIndex , MultiIndex .from_frame (* args , ** kwargs ))
109-
110- def from_tuples (self , * args , ** kwargs ) -> MultiIndex :
111- """Construct a MultiIndex using the associated Session.
112-
113- See :func:`bigframes.pandas.MultiIndex.from_tuples`.
114- """
115- return MultiIndex .from_tuples (* args , session = self ._session , ** kwargs )
0 commit comments