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 on Import - TypeError: _TypedDictMeta.__new__() got an unexpected keyword argument 'closed' #3684

Open
abdullahau opened this issue Nov 17, 2024 · 5 comments · Fixed by #3683
Labels

Comments

@abdullahau
Copy link

abdullahau commented Nov 17, 2024

What happened?

I am trying to import atlair on my jupyter notebook in vscode. I have a virtual environment of Python 3.13 running where I have installed atlair with all its optional dependencies. However, as I try to import Atlair as following:

import altair as alt

I get the following error:

TypeError                                 Traceback (most recent call last)
Cell In[1], line 1
----> 1 import altair as alt

File ~/Documents/Coding-Projects/.venv/lib/python3.13/site-packages/altair/__init__.py:650
    646 def __dir__():
    647     return __all__
--> 650 from altair.vegalite import *
    651 from altair.vegalite.v5.schema.core import Dict
    652 from altair.jupyter import JupyterChart

File ~/Documents/Coding-Projects/.venv/lib/python3.13/site-packages/altair/vegalite/__init__.py:2
      1 # ruff: noqa: F403
----> 2 from .v5 import *

File ~/Documents/Coding-Projects/.venv/lib/python3.13/site-packages/altair/vegalite/v5/__init__.py:4
      1 # ruff: noqa: F401, F403
      2 from altair.expr.core import datum
----> 4 from .api import *
      5 from .compiler import vegalite_compilers
      6 from .data import (
      7     MaxRowsError,
      8     data_transformers,
   (...)
     14     to_values,
     15 )

File ~/Documents/Coding-Projects/.venv/lib/python3.13/site-packages/altair/vegalite/v5/api.py:618
    614         raise TypeError(if_false)
    615     return selection
--> 618 class _ConditionClosed(TypedDict, closed=True, total=False):  # type: ignore[call-arg]
    619     # https://peps.python.org/pep-0728/
    620     # Parameter {"param", "value", "empty"}
    621     # Predicate {"test", "value"}
    622     empty: Optional[bool]
    623     param: Parameter | str

TypeError: _TypedDictMeta.__new__() got an unexpected keyword argument 'closed'

What would you like to happen instead?

No response

Which version of Altair are you using?

altair==5.4.1

@jgunstone
Copy link

jgunstone commented Nov 18, 2024

also getting this issue
FYI
issue persists in altair==5.4.0 but is not present in altair==5.3

@abdullahau
Copy link
Author

abdullahau commented Nov 18, 2024

@jgunstone I downloaded the Altair source repo and installed the package directly. The issue was resolved, and Altair has been working fine since yesterday.

@jgunstone
Copy link

jgunstone commented Nov 18, 2024

@jgunstone I downloaded the Altair source repo and installed the packed directly. The issue was resolved, and Altair has been working fine since yesterday.

as in the issue has been fixed in the main branch but hasn't been released yet?

@raethlein
Copy link

I believe it is due to Python 3.13 and, if so, a duplicate of #3620, which was fixed in #3591.

Does someone know a rough timeline for the next release of 5.5 which will support Python 3.13? 🙂

@dangotbanned
Copy link
Member

I believe it is due to Python 3.13 and, if so, a duplicate of #3620, which was fixed in #3591.

Does someone know a rough timeline for the next release of 5.5 which will support Python 3.13? 🙂

@raethlein I've opened a discussion on this now in:

Hopefully that should make this easier to track 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants