Visitar URL original
Multiple inheritance with NamedTuple not supported since Python 3.9 · Issue #23 · AmpX-AI/fsql · GitHub
Skip to content

Multiple inheritance with NamedTuple not supported since Python 3.9 #23

Closed

Description

@jakubpernis

Due to this python/cpython#19363 one gets TypeError when trying to use fsql with python>=3.9:

from fsql.api import read_partitioned_table

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In [4], line 1
----> 1 from fsql.api import read_partitioned_table

File /opt/homebrew/lib/python3.9/site-packages/fsql/api.py:51
     49 from fsql import get_url_and_fs
     50 from fsql.column_parser import AUTO_PARSER, ColumnParser
---> 51 from fsql.deser import PANDAS_READER, DataObject, DataObjectRich, DataReader
     52 from fsql.partition import Partition
     53 from fsql.partition_discovery import discover_partitions

File /opt/homebrew/lib/python3.9/site-packages/fsql/deser.py:95
     84         return {
     85             "json": InputFormat.JSON,
     86             "parquet": InputFormat.PARQUET,
     87             "csv": InputFormat.CSV,
     88             "xlsx": InputFormat.XLSX,
     89         }[url]
     92 DataObject = TypeVar("DataObject")
---> 95 class DataObjectRich(NamedTuple, Generic[DataObject]):
     96     data: DataObject
     97     failures: Iterable[PartitionReadFailure]

File /opt/homebrew/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/typing.py:1929, in _namedtuple_mro_entries(bases)
   1927 def _namedtuple_mro_entries(bases):
   1928     if len(bases) > 1:
-> 1929         raise TypeError("Multiple inheritance with NamedTuple is not supported")
   1930     assert bases[0] is NamedTuple
   1931     return (_NamedTuple,)

TypeError: Multiple inheritance with NamedTuple is not supported

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions