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

altair 4.2 AttributeError: 'list' object has no attribute 'get' on chart.projection with center #2707

Closed
Casyfill opened this issue Nov 4, 2022 · 7 comments
Labels

Comments

@Casyfill
Copy link

Casyfill commented Nov 4, 2022

with 4.2 Altair fails once I try to pass projection with center as a list:

>>> import altair as alt
>>> basic_chart = alt.Chart().properties(height=800, width=700)
>>> NYC_PRJ = {"type": "mercator", "center": [-73.99, 40.72]}
>>> basic_chart.project(**NYC_PRJ)

Raises this:

... /site-packages/jsonschema/validators.py", line 101, in _id_of
  return schema.get("$id", "")
AttributeError: 'list' object has no attribute 'get'

@Casyfill Casyfill added the bug label Nov 4, 2022
@jakevdp
Copy link
Collaborator

jakevdp commented Nov 4, 2022

Hi, thanks for the report - this looks quite similar to #2496

Which version of the jsonschema package do you have installed?

@Casyfill
Copy link
Author

Casyfill commented Nov 4, 2022

4.17.0, I assume I have to set it to <4

@Casyfill
Copy link
Author

Casyfill commented Nov 4, 2022

PS. confirming that jsonschema<4 fixes the issue

@joelostblom
Copy link
Contributor

In addition to #2496, there is another issue with jsonschema 4.17 that is being tracked in #2705 so closing this issue for now but please comment if you think there is something that is not covered by those two issues.

@Casyfill
Copy link
Author

Casyfill commented Nov 4, 2022

Sure, thanks! is fixing altair to dfschema<4 as a temp patch an option?

@joelostblom
Copy link
Contributor

Yeah we might do that (at least temporarily for CI) , but it wouldn't go into effect until the next release anyways so we should also try to figure out what goes wrong and make Altair compatible with newer json schema versions. Doing it locally with 4.2 would be totally ok.

@lennox55555
Copy link

How would you go about installing version <4 through !pip command

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

4 participants