fix: make Frame/Column inherit from pandas classes

This commit is contained in:
2026-07-07 13:43:57 +02:00
parent ed07b01563
commit c2f41eb392

View File

@@ -1,6 +1,8 @@
from typing import Generic, TypeVar from typing import Generic, TypeVar
from typing import cast as typing_cast from typing import cast as typing_cast
from pandas import DataFrame, Series
cast = typing_cast cast = typing_cast
"""### Midas documentation """### Midas documentation
Cast a value to a type. Cast a value to a type.
@@ -38,14 +40,14 @@ _**Internal Python documentation**_
T = TypeVar("T") T = TypeVar("T")
class Frame(Generic[T]): class Frame(DataFrame, Generic[T]):
"""A `Frame` is the abstract type implemented by `DataFrame` """A `Frame` is the abstract type implemented by `DataFrame`
A frame contains any number of named columns (see :class:`Column`) A frame contains any number of named columns (see :class:`Column`)
""" """
class Column(Generic[T]): class Column(Series, Generic[T]):
"""A `Column` is the abstract type implemented by `Series` """A `Column` is the abstract type implemented by `Series`
A column contains a any number of values of the same type A column contains a any number of values of the same type