Update altair to suppress incorrect python type checker errors

Summary

I run a python typechecker when editing my streamlit code, and it was objecting to nearly every call to the altair charting library. I described the problem and steps to reproduce here: how to suppress errors about a library with types set to 'UndefinedType'? · Issue #3210 · microsoft/pylance-release · GitHub

(For background, I’m using VSCode’s python extension, which runs the pylance typechecker, but I’m not sure this is specific to that environment.)

The altair folks kindly merged my fix yesterday ( use 'UndefinedLike = Any' as the type hint by brahn · Pull Request #2681 · altair-viz/altair · GitHub ) but they do not have any timeline for a version release.

If other streamlit users are running into the same problem, it may be helpful to bump the streamlit dependency to include this commit.

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.