Skip to content

Commit f9725e2

Browse files
Merge pull request pydata#270 from davidastephens/EDGAR
TST: Skip EDGAR tests until rewrite
2 parents 2bc8338 + 66467c1 commit f9725e2

File tree

6 files changed

+30
-12
lines changed

6 files changed

+30
-12
lines changed

docs/source/remote_data.rst

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,9 @@ You can specify dataset ID "tran_sf_railac" to get corresponding data via ``Data
471471
EDGAR Index
472472
===========
473473
474+
** As of December 31st, the SEC disabled access via FTP. EDGAR support
475+
currently broken until re-write to use HTTPS. **
476+
474477
Company filing index from EDGAR (SEC).
475478
476479
The daily indices get large quickly (i.e. the set of daily indices from 1994
@@ -480,17 +483,17 @@ If the FTP server starts refusing your connections, you should be able to
480483
reconnect after waiting a few minutes.
481484
482485
483-
.. ipython:: python
486+
.. .. ipython:: python
484487
485-
import pandas_datareader.data as web
486-
ed = web.DataReader('full', 'edgar-index')
487-
ed[:5]
488+
.. import pandas_datareader.data as web
489+
.. ed = web.DataReader('full', 'edgar-index')
490+
.. ed[:5]
488491
489-
.. ipython:: python
492+
.. .. ipython:: python
490493
491-
import pandas_datareader.data as web
492-
ed = web.DataReader('daily', 'edgar-index', '1998-05-18', '1998-05-18')
493-
ed[:5]
494+
.. import pandas_datareader.data as web
495+
.. ed = web.DataReader('daily', 'edgar-index', '1998-05-18', '1998-05-18')
496+
.. ed[:5]
494497
495498
.. _remote_data.tsp:
496499

pandas_datareader/google/options.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ def _process_data(self, jd, expiry):
137137
indexes = ['Strike', 'Expiry', 'Type', 'Symbol']
138138
rows_list, index = self._process_rows(jd, now, expiry)
139139
df = DataFrame(rows_list, columns=columns, index=MultiIndex.from_tuples(index, names=indexes))
140+
141+
# Make dtype consistent, requires float64 as there can be NaNs
142+
df['Vol'] = df['Vol'].astype('float64')
143+
df['Open_Int'] = df['Open_Int'].astype('float64')
144+
140145
return df.sort_index()
141146

142147
def _process_rows(self, jd, now, expiry):

pandas_datareader/tests/test_edgar.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
class TestEdgarIndex(tm.TestCase):
1111

1212
def test_get_full_index(self):
13+
# As of December 31, SEC has disabled ftp access to EDGAR. Disabling tests until re-write
14+
raise nose.SkipTest()
1315
try:
1416
ed = web.DataReader('full', 'edgar-index')
1517
assert len(ed) > 1000
@@ -22,6 +24,8 @@ def test_get_full_index(self):
2224
raise nose.SkipTest(e)
2325

2426
def test_get_nonzip_index_and_low_date(self):
27+
# As of December 31, SEC has disabled ftp access to EDGAR. Disabling tests until re-write
28+
raise nose.SkipTest()
2529
try:
2630
ed = web.DataReader('daily', 'edgar-index', '1994-06-30',
2731
'1994-07-02')
@@ -48,6 +52,8 @@ def test_get_gz_index_and_no_date(self):
4852
raise nose.SkipTest(e)
4953

5054
def test_6_digit_date(self):
55+
# As of December 31, SEC has disabled ftp access to EDGAR. Disabling tests until re-write
56+
raise nose.SkipTest()
5157
try:
5258
ed = web.DataReader('daily', 'edgar-index', start='1998-05-18',
5359
end='1998-05-18')

pandas_datareader/tests/test_google_options.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def assert_option_result(self, df):
3131
tm.assert_index_equal(df.columns, exp_columns)
3232
tm.assert_equal(df.index.names, [u'Strike', u'Expiry', u'Type', u'Symbol'])
3333

34-
dtypes = ['float64'] * 6 + ['int64', 'object', 'float64', 'datetime64[ns]']
34+
dtypes = ['float64'] * 7 + ['object', 'float64', 'datetime64[ns]']
3535
dtypes = [np.dtype(x) for x in dtypes]
3636
tm.assert_series_equal(df.dtypes, pd.Series(dtypes, index=exp_columns))
3737

@@ -54,7 +54,7 @@ def test_expiry_dates(self):
5454
except RemoteDataError as e: # pragma: no cover
5555
raise nose.SkipTest(e)
5656

57-
self.assertTrue(len(dates) >= 5)
57+
self.assertTrue(len(dates) >= 4)
5858
self.assertIsInstance(dates, list)
5959
self.assertTrue(all(isinstance(dt, date) for dt in dates))
6060

pandas_datareader/tests/test_yahoo_options.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ def assert_option_result(self, df):
5050
tm.assert_index_equal(df.columns, exp_columns)
5151
tm.assert_equal(df.index.names, [u'Strike', u'Expiry', u'Type', u'Symbol'])
5252

53-
dtypes = [np.dtype(x) for x in ['float64'] * 5 +
54-
['int64', 'int64', 'float64', 'object', 'bool', 'object', 'float64', 'datetime64[ns]',
53+
dtypes = [np.dtype(x) for x in ['float64'] * 7 +
54+
['float64', 'object', 'bool', 'object', 'float64', 'datetime64[ns]',
5555
'datetime64[ns]', 'object']]
5656
tm.assert_series_equal(df.dtypes, pd.Series(dtypes, index=exp_columns))
5757

pandas_datareader/yahoo/options.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,10 @@ def _process_data(self, jd):
684684

685685
df['IsNonstandard'] = df['Root'] != self.symbol.replace('-', '')
686686

687+
# Make dtype consistent, requires float64 as there can be NaNs
688+
df['Vol'] = df['Vol'].astype('float64')
689+
df['Open_Int'] = df['Open_Int'].astype('float64')
690+
687691
return df.sort_index()
688692

689693
def _process_rows(self, jd):

0 commit comments

Comments
 (0)