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

TypeError when importing atoti with Python 3.8.10 and 3.9.5 #274

Closed
adamxyzxyz opened this issue May 5, 2021 · 5 comments
Closed

TypeError when importing atoti with Python 3.8.10 and 3.9.5 #274

adamxyzxyz opened this issue May 5, 2021 · 5 comments
Assignees
Labels
🐛 bug unexpected or wrong behavior
Milestone

Comments

@adamxyzxyz
Copy link

When I run import atoti, I get the following error:

TypeError: cannot inherit frozen dataclass from a non-frozen one

@adamxyzxyz adamxyzxyz added the 🐛 bug unexpected or wrong behavior label May 5, 2021
@tibdex
Copy link
Member

tibdex commented May 6, 2021

Hi, so that we can help you, please share:

  • your version of Python
  • which OS you are using
  • the version of atoti you tried to install
  • the traceback of the TypeError you're getting

@adamxyzxyz
Copy link
Author

adamxyzxyz commented May 6, 2021

Hello,

  • Python 3.9 (64 bit)
  • Windows 10
traceback
TypeError                                 Traceback (most recent call last)
 in 
----> 1 import atoti

~\desktop\mechenv\lib\site-packages\atoti_init_.py in
5 _compatibility, # pylint: disable=redefined-builtin; Import first to fail fast
6 )
----> 7 from . import (
8 _functions,
9 agg,

~\desktop\mechenv\lib\site-packages\atoti_functions_init_.py in
1 # pylint: disable=redefined-builtin
2
----> 3 from .date import date_diff
4 from .measure import filter, rank, value, where
5 from .multidimensional import _first, _last, at, date_shift, parent_value, shift, total

~\desktop\mechenv\lib\site-packages\atoti_functions\date.py in
6 from typing_extensions import Literal
7
----> 8 from .._measures.calculated_measure import CalculatedMeasure, Operator
9 from ..measure import Measure, MeasureConvertible, _convert_to_measure
10

~\desktop\mechenv\lib\site-packages\atoti_measures\calculated_measure.py in
5
6 from ..measure import Measure
----> 7 from ..scope._utils import LeafLevels
8 from .utils import convert_measure_args
9

~\desktop\mechenv\lib\site-packages\atoti\scope_init_.py in
1 from typing import Optional, Tuple, Union
2
----> 3 from atoti.hierarchy import Hierarchy
4 from atoti.level import Level
5

~\desktop\mechenv\lib\site-packages\atoti\hierarchy.py in
5 from typing import TYPE_CHECKING, Any, Callable, Mapping
6
----> 7 from ._base._base_hierarchy import BaseHierarchy
8 from .level import Level
9

~\desktop\mechenv\lib\site-packages\atoti_base_base_hierarchy.py in
5 from .._bitwise_operators_only import BitwiseOperatorsOnly, IdentityElement
6 from .._docs_utils import HIERARCHY_ISIN_DOC, doc
----> 7 from .._hierarchy_isin_conditions import (
8 HierarchyIsInCondition,
9 create_condition_from_member_paths,

~\desktop\mechenv\lib\site-packages\atoti_hierarchy_isin_conditions.py in
14
15 @dataclass(frozen=True)
---> 16 class HierarchyIsInCondition(Condition, MeasureConvertible):
17 """Class for isin condition on cube hierarchies."""
18

C:\Program Files\Python39\lib\dataclasses.py in wrap(cls)
1011
1012 def wrap(cls):
-> 1013 return _process_class(cls, init, repr, eq, order, unsafe_hash, frozen)
1014
1015 # See if we're being called as @dataclass or @dataclass().

C:\Program Files\Python39\lib\dataclasses.py in _process_class(cls, init, repr, eq, order, unsafe_hash, frozen)
896 # Raise an exception if we're frozen, but none of our bases are.
897 if not any_frozen_base and frozen:
--> 898 raise TypeError('cannot inherit frozen dataclass from a '
899 'non-frozen one')
900

TypeError: cannot inherit frozen dataclass from a non-frozen one

@tibdex
Copy link
Member

tibdex commented May 6, 2021

I have the same issue with Python 3.8.10 that was released the 2021-05-03 (same day as atoti 0.5.4). This is new CPython code leading to an error being raised.

While we look for a solution, you can try with Python < 3.8.10.

@adamxyzxyz
Copy link
Author

So use an older version of python for now for it to work?

@tibdex tibdex changed the title TypeError: cannot inherit frozen dataclass from a non-frozen one TypeError when importing atoti with Python 3.8.10 and 3.9.5 May 6, 2021
@tibdex tibdex added this to the Next release milestone May 7, 2021
@patachoux patachoux bot closed this as completed May 10, 2021
@tibdex
Copy link
Member

tibdex commented May 10, 2021

atoti 0.5.5 has just been released to fix this issue. You can try again with Python 3.8.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug unexpected or wrong behavior
Projects
None yet
Development

No branches or pull requests

2 participants