Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Merge branch 'master' of https://github.com/pandas-dev/pandas into cl…
…n-iterator
  • Loading branch information
jbrockmendel committed Dec 21, 2019
commit 0ce13b5307d8470ccfcf7d25e67d6040981a8c70
5 changes: 2 additions & 3 deletions pandas/io/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import bz2
import codecs
from collections.abc import Iterator
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be failing ci on Check for non-standard imports

log shows

##[error]pandas/io/stata.py:12:from collections.abc import Iterator
##[error]pandas/io/sas/sas7bdat.py:16:from collections.abc import Iterator
##[error]pandas/io/sas/sas_xport.py:10:from collections.abc import Iterator
##[error]pandas/io/common.py:5:from collections.abc import Iterator
##[error]pandas/io/parsers.py:6:from collections.abc import Iterator
##[error]pandas/io/json/_json.py:2:from collections.abc import Iterator

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes to invgrep in #29915. maybe related. @datapythonista

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's strange, because I tested that the exit codes were correct in that PR, but I agree the problem is likely to be introduced in that PR.

I'm travelling without my computer at the moment, and I can't test myself. But feel free to revert that PR if you identify it's the one causing the problem, and I'll redo it with the problem fixed later.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the preferred way to do the import?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the correct way to do the import? I'm getting this failure in my PR https://github.com/pandas-dev/pandas/pull/30151/checks?check_run_id=362567629

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the import is correct. Must be something wrong with the invgrep as noted by @simonjayhawkins

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alimcmaster1 might have an idea here as well

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure from reading #25957 (review) where this check was implemented our preferred way to do the import is from collections import abc. Or from collections import Iterator

I can update this now if helpful @mroeschke ?

Agree - seems to be something flakey with the invgrep on github actions since fails for me locally.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That'd be great @alimcmaster1, thanks!

import csv
import gzip
from io import BufferedIOBase, BytesIO
import mmap
Expand Down Expand Up @@ -51,7 +50,7 @@
_VALID_URLS.discard("")


def _is_url(url) -> bool:
def is_url(url) -> bool:
"""
Check to see if a URL has a valid protocol.

Expand Down Expand Up @@ -505,7 +504,7 @@ def closed(self):
return self.fp is None


class MMapWrapper(Iterator):
class _MMapWrapper(Iterator):
"""
Wrapper for the Python's mmap class so that it can be properly read in
by Python's csv.reader class.
Expand Down
3 changes: 0 additions & 3 deletions pandas/io/json/_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
from pandas.core.reshape.concat import concat

from pandas.io.common import (
_get_handle,
_infer_compression,
_stringify_path,
get_filepath_or_buffer,
get_handle,
infer_compression,
Expand Down
1 change: 0 additions & 1 deletion pandas/io/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
from pandas.core.tools import datetimes as tools

from pandas.io.common import (
UnicodeReader,
UTF8Recoder,
get_filepath_or_buffer,
get_handle,
Expand Down
2 changes: 1 addition & 1 deletion pandas/io/stata.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
from pandas.core.frame import DataFrame
from pandas.core.series import Series

from pandas.io.common import _stringify_path, get_filepath_or_buffer
from pandas.io.common import get_filepath_or_buffer, stringify_path

_version_error = (
"Version of given Stata file is not 104, 105, 108, "
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.