Skip to content

Commit 359017f

Browse files
committed
Merge pull request #4573 from jtratner/fix-url-parse-call
BUG: Fix incorrect urlparse in _is_s3_url
2 parents 146ee99 + 6a04c2c commit 359017f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pandas/io/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def _is_url(url):
6161
def _is_s3_url(url):
6262
"""Check for an s3 url"""
6363
try:
64-
return urlparse.urlparse(url).scheme == 's3'
64+
return parse_url(url).scheme == 's3'
6565
except:
6666
return False
6767

pandas/io/tests/test_data.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,10 @@ def test_get_put_data_warning(self):
332332

333333

334334
class TestDataReader(unittest.TestCase):
335+
def test_is_s3_url(self):
336+
from pandas.io.common import _is_s3_url
337+
self.assert_(_is_s3_url("s3://pandas/somethingelse.com"))
338+
335339
@network
336340
def test_read_yahoo(self):
337341
gs = DataReader("GS", "yahoo")

0 commit comments

Comments
 (0)