Skip to content

TST: Remaining tseries tests reorg (gh14854) #15359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/source/whatsnew/v0.20.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ Other API Changes
- ``pandas.api.types.is_datetime64_ns_dtype`` will now report ``True`` on a tz-aware dtype, similar to ``pandas.api.types.is_datetime64_any_dtype``
- ``DataFrame.asof()`` will return a null filled ``Series`` instead the scalar ``NaN`` if a match is not found (:issue:`15118`)
- The :func:`pd.read_gbq` method now stores ``INTEGER`` columns as ``dtype=object`` if they contain ``NULL`` values. Otherwise they are stored as ``int64``. This prevents precision lost for integers greather than 2**53. Furthermore ``FLOAT`` columns with values above 10**4 are no more casted to ``int64`` which also caused precision lost (:issue: `14064`, :issue:`14305`).
- Reorganization of timeseries tests - ``pandas/tests/scalar``, ``pandas/tests/indexes``, ``pandas/tests/tseries`` (:issue:`14854`)

.. _whatsnew_0200.deprecations:

Expand Down
14 changes: 13 additions & 1 deletion pandas/tests/indexes/datetimes/test_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
import pandas.util.testing as tm
from pandas.core.common import PerformanceWarning
from pandas.tseries.index import cdate_range
from pandas.tseries.frequencies import get_offset, to_offset
from pandas import (DatetimeIndex, PeriodIndex, Series, Timestamp, Timedelta,
date_range, TimedeltaIndex, _np_version_under1p10, Index,
datetime, Float64Index, offsets, bdate_range)
from pandas.tseries.offsets import BMonthEnd, CDay, BDay
from pandas.tseries.offsets import (BMonthEnd, CDay, BDay, Milli, MonthBegin,
Micro)
from pandas.tests.test_base import Ops


Expand Down Expand Up @@ -911,6 +913,16 @@ def test_equals(self):
self.assertFalse(idx.equals(list(idx3)))
self.assertFalse(idx.equals(pd.Series(idx3)))

def test_ms_vs_MS(self):
left = get_offset('ms')
right = get_offset('MS')
self.assertEqual(left, Milli())
self.assertEqual(right, MonthBegin())

def test_rule_aliases(self):
rule = to_offset('10us')
self.assertEqual(rule, Micro(10))


class TestDateTimeIndexToJulianDate(tm.TestCase):

Expand Down
10 changes: 9 additions & 1 deletion pandas/tests/indexes/datetimes/test_setops.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pandas.util.testing as tm
from pandas.tseries.index import cdate_range
from pandas import (DatetimeIndex, date_range, Series, bdate_range, DataFrame,
Int64Index, Index)
Int64Index, Index, to_datetime)
from pandas.tseries.offsets import Minute, BMonthEnd, MonthEnd

START, END = datetime(2009, 1, 1), datetime(2010, 1, 1)
Expand Down Expand Up @@ -190,6 +190,14 @@ def test_datetimeindex_union_join_empty(self):
result = dti.join(empty)
tm.assertIsInstance(result, DatetimeIndex)

def test_join_nonunique(self):
idx1 = to_datetime(['2012-11-06 16:00:11.477563',
'2012-11-06 16:00:11.477563'])
idx2 = to_datetime(['2012-11-06 15:11:09.006507',
'2012-11-06 15:11:09.006507'])
rs = idx1.join(idx2, how='outer')
self.assertTrue(rs.is_monotonic)


class TestBusinessDatetimeIndex(tm.TestCase):

Expand Down
File renamed without changes.
Binary file removed pandas/tseries/tests/data/daterange_073.pickle
Binary file not shown.
Binary file removed pandas/tseries/tests/data/frame.pickle
Binary file not shown.
Binary file removed pandas/tseries/tests/data/series.pickle
Binary file not shown.
Binary file removed pandas/tseries/tests/data/series_daterange0.pickle
Binary file not shown.
219 changes: 0 additions & 219 deletions pandas/tseries/tests/test_timeseries_legacy.py

This file was deleted.

5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,13 +648,13 @@ def pxd(name):
'pandas.tests.series',
'pandas.tests.formats',
'pandas.tests.scalar',
'pandas.tests.tseries',
'pandas.tests.types',
'pandas.tests.test_msgpack',
'pandas.tests.plotting',
'pandas.tools',
'pandas.tools.tests',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also need to make a change in package_data to move the actual data files

'pandas.tseries',
'pandas.tseries.tests',
'pandas.types',
'pandas.io.tests',
'pandas.io.tests.json',
Expand Down Expand Up @@ -688,8 +688,7 @@ def pxd(name):
'pandas.tests': ['data/*.csv'],
'pandas.tests.formats': ['data/*.csv'],
'pandas.tests.indexes': ['data/*.pickle'],
'pandas.tseries.tests': ['data/*.pickle',
'data/*.csv']
'pandas.tests.tseries': ['data/*.pickle']
},
ext_modules=extensions,
maintainer_email=EMAIL,
Expand Down