From 9274284a16962c55df1faff2db20ec1e0d55313f Mon Sep 17 00:00:00 2001 From: dangotbanned <125183946+dangotbanned@users.noreply.github.com> Date: Mon, 2 Dec 2024 16:08:48 +0000 Subject: [PATCH] refactor(ruff): Apply `TC006` fixes in new code Related https://github.com/vega/altair/pull/3706 --- tests/test_datasets.py | 2 +- tools/datasets/datapackage.py | 2 +- tools/datasets/github.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_datasets.py b/tests/test_datasets.py index 9d91c275e..f9dd4c5a3 100644 --- a/tests/test_datasets.py +++ b/tests/test_datasets.py @@ -493,7 +493,7 @@ def test_reader_cache( if nw_dep.is_polars_dataframe(lookup_groups): left, right = ( lookup_groups, - cast(pl.DataFrame, data("lookup_groups", tag="v2.5.3")), + cast("pl.DataFrame", data("lookup_groups", tag="v2.5.3")), ) else: left, right = ( diff --git a/tools/datasets/datapackage.py b/tools/datasets/datapackage.py index da1f8375e..deb63fbb9 100644 --- a/tools/datasets/datapackage.py +++ b/tools/datasets/datapackage.py @@ -9,7 +9,7 @@ from collections import deque from pathlib import Path -from typing import TYPE_CHECKING, Any, Literal, get_args +from typing import TYPE_CHECKING, Any, Literal import polars as pl from polars import col diff --git a/tools/datasets/github.py b/tools/datasets/github.py index b9b156c60..406eca3dc 100644 --- a/tools/datasets/github.py +++ b/tools/datasets/github.py @@ -487,4 +487,4 @@ def _iter_rows(df: pl.DataFrame, stop: int | None, /, tp: type[_TD]) -> Iterator if not TYPE_CHECKING: assert is_typeddict(tp) or issubclass(tp, Mapping) - return cast(Iterator[_TD], islice(df.iter_rows(named=True), stop)) + return cast("Iterator[_TD]", islice(df.iter_rows(named=True), stop))