From 53faab56c09c53db8add77575ad3a81de27e3c27 Mon Sep 17 00:00:00 2001 From: Crystal Gong Date: Sat, 24 Feb 2018 02:12:36 -0600 Subject: [PATCH 1/5] commented out block about nan code that should be unreachable --- .pytest_cache/v/cache/lastfailed | 11 +++++++++++ pandas/core/arrays/categorical.py | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 .pytest_cache/v/cache/lastfailed diff --git a/.pytest_cache/v/cache/lastfailed b/.pytest_cache/v/cache/lastfailed new file mode 100644 index 0000000000000..efa2390f9ecab --- /dev/null +++ b/.pytest_cache/v/cache/lastfailed @@ -0,0 +1,11 @@ +{ + "pandas/tests/io/parser/test_network.py::TestS3::()::test_infer_s3_compression": true, + "pandas/tests/io/parser/test_network.py::TestS3::()::test_parse_public_s3_bucket_chunked": true, + "pandas/tests/io/parser/test_network.py::TestS3::()::test_parse_public_s3_bucket_chunked_python": true, + "pandas/tests/io/parser/test_network.py::TestS3::()::test_parse_public_s3_bucket_nrows": true, + "pandas/tests/io/parser/test_network.py::TestS3::()::test_parse_public_s3_bucket_nrows_python": true, + "pandas/tests/io/parser/test_network.py::TestS3::()::test_parse_public_s3_bucket_python": true, + "pandas/tests/io/parser/test_network.py::TestS3::()::test_parse_public_s3a_bucket": true, + "pandas/tests/io/parser/test_network.py::TestS3::()::test_parse_public_s3n_bucket": true, + "pandas/tests/io/parser/test_network.py::TestS3::()::test_s3_fails": true +} \ No newline at end of file diff --git a/pandas/core/arrays/categorical.py b/pandas/core/arrays/categorical.py index 493b2e5bd899b..89fd672c797eb 100644 --- a/pandas/core/arrays/categorical.py +++ b/pandas/core/arrays/categorical.py @@ -1621,7 +1621,7 @@ def fillna(self, value=None, method=None, limit=None): "been implemented yet") values = self._codes - + """ # Make sure that we also get NA in categories if self.categories.dtype.kind in ['S', 'O', 'f']: if np.nan in self.categories: @@ -1629,7 +1629,7 @@ def fillna(self, value=None, method=None, limit=None): nan_pos = np.where(isna(self.categories))[0] # we only have one NA in categories values[values == nan_pos] = -1 - + """ # pad / bfill if method is not None: From 0e87c5abaf1f33a5d24ea2abe7ce21814b0b37ec Mon Sep 17 00:00:00 2001 From: Crystal Gong Date: Sat, 24 Feb 2018 02:50:18 -0600 Subject: [PATCH 2/5] removed and tested code associated with issue #19787 Categorical.fillna NaN in categories checking --- pandas/core/arrays/categorical.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/pandas/core/arrays/categorical.py b/pandas/core/arrays/categorical.py index 89fd672c797eb..05dc1d618f295 100644 --- a/pandas/core/arrays/categorical.py +++ b/pandas/core/arrays/categorical.py @@ -1621,15 +1621,7 @@ def fillna(self, value=None, method=None, limit=None): "been implemented yet") values = self._codes - """ - # Make sure that we also get NA in categories - if self.categories.dtype.kind in ['S', 'O', 'f']: - if np.nan in self.categories: - values = values.copy() - nan_pos = np.where(isna(self.categories))[0] - # we only have one NA in categories - values[values == nan_pos] = -1 - """ + # pad / bfill if method is not None: From d8309b5cfc68fa79397c6722fa43feab3f3c0175 Mon Sep 17 00:00:00 2001 From: Crystal Gong Date: Sat, 24 Feb 2018 11:48:23 -0600 Subject: [PATCH 3/5] added .pytest_cache to .gitignore file --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 0d4e8c6fb75a6..9f4189c7fd5b8 100644 --- a/.gitignore +++ b/.gitignore @@ -79,6 +79,8 @@ Thumbs.db pandas/io/*.dat pandas/io/*.json scikits +#cache files +*.pytest_cache # Generated Sources # ##################### From e00ea06fd8f405594fbed628e9a95e7df3ee2a73 Mon Sep 17 00:00:00 2001 From: Crystal Gong Date: Sat, 24 Feb 2018 11:48:55 -0600 Subject: [PATCH 4/5] removed .pytest_cache file --- .pytest_cache/v/cache/lastfailed | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 .pytest_cache/v/cache/lastfailed diff --git a/.pytest_cache/v/cache/lastfailed b/.pytest_cache/v/cache/lastfailed deleted file mode 100644 index efa2390f9ecab..0000000000000 --- a/.pytest_cache/v/cache/lastfailed +++ /dev/null @@ -1,11 +0,0 @@ -{ - "pandas/tests/io/parser/test_network.py::TestS3::()::test_infer_s3_compression": true, - "pandas/tests/io/parser/test_network.py::TestS3::()::test_parse_public_s3_bucket_chunked": true, - "pandas/tests/io/parser/test_network.py::TestS3::()::test_parse_public_s3_bucket_chunked_python": true, - "pandas/tests/io/parser/test_network.py::TestS3::()::test_parse_public_s3_bucket_nrows": true, - "pandas/tests/io/parser/test_network.py::TestS3::()::test_parse_public_s3_bucket_nrows_python": true, - "pandas/tests/io/parser/test_network.py::TestS3::()::test_parse_public_s3_bucket_python": true, - "pandas/tests/io/parser/test_network.py::TestS3::()::test_parse_public_s3a_bucket": true, - "pandas/tests/io/parser/test_network.py::TestS3::()::test_parse_public_s3n_bucket": true, - "pandas/tests/io/parser/test_network.py::TestS3::()::test_s3_fails": true -} \ No newline at end of file From a11a58b71f35bd4d794928814ec5f96e185f036f Mon Sep 17 00:00:00 2001 From: Jeff Reback Date: Wed, 7 Mar 2018 18:45:40 -0500 Subject: [PATCH 5/5] minor --- .gitignore | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 8697449c3f416..22e13fb825575 100644 --- a/.gitignore +++ b/.gitignore @@ -61,6 +61,7 @@ dist .coverage coverage.xml coverage_html_report +*.pytest_cache # OS generated files # ###################### @@ -79,8 +80,6 @@ Thumbs.db pandas/io/*.dat pandas/io/*.json scikits -#cache files -*.pytest_cache # Generated Sources # ##################### @@ -92,7 +91,6 @@ scikits # Unit / Performance Testing # ############################## -.pytest_cache/ asv_bench/env/ asv_bench/html/ asv_bench/results/