Skip to content

Commit a5a0c79

Browse files
Fix abc.Iterator import error
Change `import abc` to `from collections import abc` to fix AttributeError where `abc.Iterator` was not found (standard library abc module doesn't have Iterator, it's in collections.abc). Also add cast to fix mypy no-any-return errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent cef042a commit a5a0c79

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pyathena/polars/result_set.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import annotations
33

4-
import abc
54
import logging
5+
from collections import abc
66
from multiprocessing import cpu_count
77
from typing import (
88
TYPE_CHECKING,
@@ -14,6 +14,7 @@
1414
Optional,
1515
Tuple,
1616
Union,
17+
cast,
1718
)
1819

1920
from pyathena import OperationalError
@@ -139,7 +140,7 @@ def as_polars(self) -> "pl.DataFrame":
139140
"""
140141
import polars as pl
141142

142-
dfs = list(self)
143+
dfs = cast(List["pl.DataFrame"], list(self))
143144
if not dfs:
144145
return pl.DataFrame()
145146
if len(dfs) == 1:

0 commit comments

Comments
 (0)