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

Closed
ddobrow opened this issue Dec 11, 2024 · 2 comments
Closed
Labels

Comments

@ddobrow
Copy link

ddobrow commented Dec 11, 2024

What happened?

TypeError                                 Traceback (most recent call last)
Cell In[2], line 2
    1 # Import altair with an abbreviated alias
----> 2 import altair as alt
    4 # Load a sample dataset as a pandas DataFrame
    5 from vega_datasets import data

File ~\Miniconda3\envs\altair\Lib\site-packages\altair\__init__.py, line 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 ~\Miniconda3\envs\altair\Lib\site-packages\altair\vegalite\__init__.py, line 2
----> 2 from .v5 import *

File ~\Miniconda3\envs\altair\Lib\site-packages\altair\vegalite\v5\__init__.py, line 4
----> 4 from .api import *

File ~\Miniconda3\envs\altair\Lib\site-packages\altair\vegalite\v5\api.py, line 618
    618 class _ConditionClosed(TypedDict, closed=True, total=False):  # type: ignore[call-arg]
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?

5.4.1

@ddobrow ddobrow added the bug label Dec 11, 2024
@mattijn mattijn changed the title Altair TypeError: _TypedDictMeta.__new__() got an unexpected keyword argument 'closed' Dec 11, 2024
@mattijn
Copy link
Contributor

mattijn commented Dec 11, 2024

Thanks for raising!

The closed argument within a TypedDict is part of PEP 728 and not available on earlier Python versions.

This was potentially fixed by #3683, which was included in the latest released version (v5.5.0).
Double checking with @dangotbanned, that is right what I'm saying?

@dangotbanned
Copy link
Member

dangotbanned commented Dec 11, 2024

This was potentially fixed by #3683, which was included in the latest released version (v5.5.0).
Double checking with @dangotbanned, that is right what I'm saying?

100% right @mattijn, thanks for checking in.
Should be fixed by updating to https://github.com/vega/altair/releases/tag/v5.5.0

This is a duplicate of

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

No branches or pull requests

3 participants