Skip to content

Commit 87614c2

Browse files
author
maxim veksler
committed
flake8.
1 parent 70adb42 commit 87614c2

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

pandas/io/common.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from pandas.io.formats.printing import pprint_thing
1212
from pandas.core.common import AbstractMethodError
1313
from pandas.core.dtypes.common import is_number, is_file_like
14-
from pandas.io.s3 import is_s3_url
1514

1615
# compat
1716
from pandas.errors import (ParserError, DtypeWarning, # noqa
@@ -161,6 +160,14 @@ def _stringify_path(filepath_or_buffer):
161160
return filepath_or_buffer
162161

163162

163+
def is_s3_url(url):
164+
"""Check for an s3, s3n, or s3a url"""
165+
try:
166+
return parse_url(url).scheme in ['s3', 's3n', 's3a']
167+
except:
168+
return False
169+
170+
164171
def get_filepath_or_buffer(filepath_or_buffer, encoding=None,
165172
compression=None, mode=None):
166173
"""

pandas/io/parquet.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
from pandas import DataFrame, RangeIndex, Int64Index, get_option
66
from pandas.compat import string_types
77
from pandas.core.common import AbstractMethodError
8-
from pandas.io.common import get_filepath_or_buffer
9-
from pandas.io.s3 import is_s3_url
8+
from pandas.io.common import get_filepath_or_buffer, is_s3_url
109

1110

1211
def get_engine(engine):

pandas/io/s3.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ def _strip_schema(url):
1818
return result.netloc + result.path
1919

2020

21-
def is_s3_url(url):
22-
"""Check for an s3, s3n, or s3a url"""
23-
try:
24-
return parse_url(url).scheme in ['s3', 's3n', 's3a']
25-
except:
26-
return False
27-
28-
2921
def get_filepath_or_buffer(filepath_or_buffer, encoding=None,
3022
compression=None, mode=None):
3123

pandas/tests/io/test_s3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pandas.io.s3 import is_s3_url
1+
from pandas.io.common import is_s3_url
22

33

44
class TestS3URL(object):

0 commit comments

Comments
 (0)