Skip to content

CLN: Fix abc imports #30455

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

Merged
merged 1 commit into from
Dec 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pandas/io/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import bz2
import codecs
from collections.abc import Iterator
from collections import abc
import gzip
from io import BufferedIOBase, BytesIO
import mmap
Expand Down Expand Up @@ -503,7 +503,7 @@ def closed(self):
return self.fp is None


class _MMapWrapper(Iterator):
class _MMapWrapper(abc.Iterator):
"""
Wrapper for the Python's mmap class so that it can be properly read in
by Python's csv.reader class.
Expand Down Expand Up @@ -540,7 +540,7 @@ def __next__(self) -> str:
return newline


class UTF8Recoder(Iterator):
class UTF8Recoder(abc.Iterator):
"""
Iterator that reads an encoded stream and re-encodes the input to UTF-8
"""
Expand Down
5 changes: 2 additions & 3 deletions pandas/io/json/_json.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from collections import OrderedDict
from collections.abc import Iterator
from collections import OrderedDict, abc
import functools
from io import StringIO
from itertools import islice
Expand Down Expand Up @@ -610,7 +609,7 @@ def read_json(
return result


class JsonReader(Iterator):
class JsonReader(abc.Iterator):
"""
JsonReader provides an interface for reading in a JSON file.

Expand Down
7 changes: 3 additions & 4 deletions pandas/io/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
Module contains tools for processing files into DataFrames or other objects
"""

from collections import defaultdict
from collections.abc import Iterator
from collections import abc, defaultdict
import csv
import datetime
from io import StringIO
Expand Down Expand Up @@ -786,7 +785,7 @@ def read_fwf(
return _read(filepath_or_buffer, kwds)


class TextFileReader(Iterator):
class TextFileReader(abc.Iterator):
"""

Passed dialect overrides any of the related parser options
Expand Down Expand Up @@ -3582,7 +3581,7 @@ def _get_col_names(colspec, columns):
return colnames


class FixedWidthReader(Iterator):
class FixedWidthReader(abc.Iterator):
"""
A reader of fixed-width lines.
"""
Expand Down
4 changes: 2 additions & 2 deletions pandas/io/sas/sas7bdat.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
Reference for binary data compression:
http://collaboration.cmc.ec.gc.ca/science/rpn/biblio/ddj/Website/articles/CUJ/1992/9210/ross/ross.htm
"""
from collections.abc import Iterator
from collections import abc
from datetime import datetime
import struct

Expand All @@ -37,7 +37,7 @@ class _column:


# SAS7BDAT represents a SAS data file in SAS7BDAT format.
class SAS7BDATReader(Iterator):
class SAS7BDATReader(abc.Iterator):
"""
Read SAS files in SAS7BDAT format.

Expand Down
4 changes: 2 additions & 2 deletions pandas/io/sas/sas_xport.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

https://support.sas.com/techsup/technote/ts140.pdf
"""
from collections.abc import Iterator
from collections import abc
from datetime import datetime
from io import BytesIO
import struct
Expand Down Expand Up @@ -251,7 +251,7 @@ def _parse_float_vec(vec):
return ieee


class XportReader(Iterator):
class XportReader(abc.Iterator):
__doc__ = _xport_reader_doc

def __init__(
Expand Down
4 changes: 2 additions & 2 deletions pandas/io/stata.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
You can find more information on http://presbrey.mit.edu/PyDTA and
http://www.statsmodels.org/devel/
"""
from collections.abc import Iterator
from collections import abc
import datetime
from io import BytesIO
import os
Expand Down Expand Up @@ -1010,7 +1010,7 @@ def __init__(self):
)


class StataReader(StataParser, Iterator):
class StataReader(StataParser, abc.Iterator):
__doc__ = _stata_reader_doc

def __init__(
Expand Down