Skip to content

Commit

Permalink
use getattr directly
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Sep 22, 2024
1 parent f792361 commit e8b5ffd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions py-polars/polars/dataframe/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@


def _maybe_extract_shorthand(encoding: Encoding) -> Encoding:
if isinstance(encoding, alt.SchemaBase) and hasattr(encoding, "shorthand"):
if isinstance(encoding, alt.SchemaBase):
# e.g. for `alt.X('x:Q', axis=alt.Axis(labelAngle=30))`, return `'x:Q'`
return encoding.shorthand
return getattr(encoding, "shorthand", encoding)
return encoding


Expand Down

0 comments on commit e8b5ffd

Please sign in to comment.