diff --git a/databricks/koalas/tests/test_dataframe.py b/databricks/koalas/tests/test_dataframe.py index fef22e432f..9bca990fe1 100644 --- a/databricks/koalas/tests/test_dataframe.py +++ b/databricks/koalas/tests/test_dataframe.py @@ -1373,6 +1373,9 @@ def test_all(self): self.assert_eq(kdf.all(), pdf.all()) + with self.assertRaisesRegex(ValueError, 'axis should be either 0 or "index" currently.'): + kdf.all(axis=1) + def test_any(self): pdf = pd.DataFrame({ 'col1': [False, False, False], @@ -1398,6 +1401,9 @@ def test_any(self): self.assert_eq(kdf.any(), pdf.any()) + with self.assertRaisesRegex(ValueError, 'axis should be either 0 or "index" currently.'): + kdf.any(axis=1) + def test_rank(self): pdf = pd.DataFrame(data={'col1': [1, 2, 3, 1], 'col2': [3, 4, 3, 1]}, columns=['col1', 'col2']) diff --git a/databricks/koalas/tests/test_series.py b/databricks/koalas/tests/test_series.py index d56269ea00..6958cc40fb 100644 --- a/databricks/koalas/tests/test_series.py +++ b/databricks/koalas/tests/test_series.py @@ -621,3 +621,9 @@ def test_shift(self): repr(pser.shift(periods=2, fill_value=0))) with self.assertRaisesRegex(ValueError, 'periods should be an int; however'): kser.shift(periods=1.5) + + def test_astype(self): + pser = pd.Series([10, 20, 15, 30, 45], name='x') + kser = koalas.Series(pser) + with self.assertRaisesRegex(ValueError, 'Type int63 not understood'): + kser.astype('int63') diff --git a/databricks/koalas/tests/test_series_datetime.py b/databricks/koalas/tests/test_series_datetime.py index 9a5e322728..72aebc4c32 100644 --- a/databricks/koalas/tests/test_series_datetime.py +++ b/databricks/koalas/tests/test_series_datetime.py @@ -57,6 +57,13 @@ def test_subtraction(self): self.assertEqual(list(kdf['diff_seconds'].toPandas()), [35545499, 33644699, 31571099]) + kdf = ks.from_pandas(pd.DataFrame({ + 'a': pd.date_range('2016-12-31', '2017-01-08', freq='D'), + 'b': pd.Series(range(9))})) + expected_error_message = 'datetime subtraction can only be applied to datetime series.' + with self.assertRaisesRegex(TypeError, expected_error_message): + kdf['a'] - kdf['b'] + @unittest.skip( "It fails in certain OSs presumably due to different " "timezone behaviours inherited from C library.")