repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/timestamp/methods/test_replace.py
pandas/tests/scalar/timestamp/methods/test_replace.py
from datetime import datetime import zoneinfo from dateutil.tz import gettz import numpy as np import pytest from pandas._libs.tslibs import ( OutOfBoundsDatetime, Timestamp, conversion, ) from pandas._libs.tslibs.dtypes import NpyDatetimeUnit from pandas.compat import WASM import pandas.util._test_decora...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/timestamp/methods/test_round.py
pandas/tests/scalar/timestamp/methods/test_round.py
from hypothesis import ( given, strategies as st, ) import numpy as np import pytest from pandas._libs import lib from pandas._libs.tslibs import ( NaT, OutOfBoundsDatetime, Timedelta, Timestamp, iNaT, to_offset, ) from pandas._libs.tslibs.dtypes import NpyDatetimeUnit from pandas._libs...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/timestamp/methods/test_tz_convert.py
pandas/tests/scalar/timestamp/methods/test_tz_convert.py
import dateutil import pytest from pandas._libs.tslibs import timezones import pandas.util._test_decorators as td from pandas import Timestamp class TestTimestampTZConvert: @pytest.mark.parametrize("tzstr", ["US/Eastern", "dateutil/US/Eastern"]) def test_astimezone(self, tzstr): # astimezone is an a...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/timestamp/methods/test_tz_localize.py
pandas/tests/scalar/timestamp/methods/test_tz_localize.py
from datetime import timedelta import re import zoneinfo from dateutil.tz import gettz import pytest from pandas._libs.tslibs.dtypes import NpyDatetimeUnit from pandas.errors import OutOfBoundsDatetime from pandas import ( NaT, Timestamp, ) class TestTimestampTZLocalize: def test_tz_localize_pushes_out...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/timestamp/methods/test_to_pydatetime.py
pandas/tests/scalar/timestamp/methods/test_to_pydatetime.py
from datetime import ( datetime, timedelta, ) import pytest from pandas._libs.tslibs.timezones import dateutil_gettz as gettz import pandas.util._test_decorators as td from pandas import Timestamp import pandas._testing as tm class TestTimestampToPyDatetime: def test_to_pydatetime_fold(self): #...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/timestamp/methods/test_as_unit.py
pandas/tests/scalar/timestamp/methods/test_as_unit.py
import pytest from pandas._libs.tslibs.dtypes import NpyDatetimeUnit from pandas.errors import OutOfBoundsDatetime from pandas import Timestamp class TestTimestampAsUnit: def test_as_unit(self): ts = Timestamp("1970-01-01").as_unit("ns") assert ts.unit == "ns" assert ts.as_unit("ns") is...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/timestamp/methods/__init__.py
pandas/tests/scalar/timestamp/methods/__init__.py
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/timestamp/methods/test_to_julian_date.py
pandas/tests/scalar/timestamp/methods/test_to_julian_date.py
from pandas import Timestamp class TestTimestampToJulianDate: def test_compare_1700(self): ts = Timestamp("1700-06-23") res = ts.to_julian_date() assert res == 2_342_145.5 def test_compare_2000(self): ts = Timestamp("2000-04-12") res = ts.to_julian_date() asser...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/timestamp/methods/test_timestamp_method.py
pandas/tests/scalar/timestamp/methods/test_timestamp_method.py
# NB: This is for the Timestamp.timestamp *method* specifically, not # the Timestamp class in general. from datetime import timezone import pytest from pandas._libs.tslibs import Timestamp from pandas.compat import WASM import pandas.util._test_decorators as td import pandas._testing as tm class TestTimestampMetho...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/timedelta/test_timedelta.py
pandas/tests/scalar/timedelta/test_timedelta.py
"""test the scalar Timedelta""" from datetime import timedelta import sys from hypothesis import ( given, strategies as st, ) import numpy as np import pytest from pandas._libs import lib from pandas._libs.missing import NA from pandas._libs.tslibs import ( NaT, iNaT, ) from pandas._libs.tslibs.dtype...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/timedelta/test_constructors.py
pandas/tests/scalar/timedelta/test_constructors.py
from datetime import timedelta from itertools import product import numpy as np import pytest from pandas._libs.tslibs import OutOfBoundsTimedelta from pandas._libs.tslibs.dtypes import NpyDatetimeUnit from pandas.errors import Pandas4Warning from pandas import ( Index, NaT, Timedelta, TimedeltaIndex...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/timedelta/test_formats.py
pandas/tests/scalar/timedelta/test_formats.py
import pytest from pandas import Timedelta @pytest.mark.parametrize( "td, expected_repr", [ (Timedelta(10, unit="D"), "Timedelta('10 days 00:00:00')"), (Timedelta(10, unit="s"), "Timedelta('0 days 00:00:10')"), (Timedelta(10, unit="ms"), "Timedelta('0 days 00:00:00.010000')"), ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/timedelta/__init__.py
pandas/tests/scalar/timedelta/__init__.py
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/timedelta/test_arithmetic.py
pandas/tests/scalar/timedelta/test_arithmetic.py
""" Tests for scalar Timedelta arithmetic ops """ from datetime import ( datetime, timedelta, ) import operator import numpy as np import pytest from pandas.errors import ( OutOfBoundsTimedelta, Pandas4Warning, ) import pandas as pd from pandas import ( NaT, Timedelta, Timestamp, off...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
true
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/timedelta/methods/test_round.py
pandas/tests/scalar/timedelta/methods/test_round.py
from hypothesis import ( given, strategies as st, ) import numpy as np import pytest from pandas._libs import lib from pandas._libs.tslibs import iNaT from pandas.errors import OutOfBoundsTimedelta from pandas import Timedelta class TestTimedeltaRound: @pytest.mark.parametrize( "freq,s1,s2", ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/timedelta/methods/test_as_unit.py
pandas/tests/scalar/timedelta/methods/test_as_unit.py
import pytest from pandas._libs.tslibs.dtypes import NpyDatetimeUnit from pandas.errors import OutOfBoundsTimedelta from pandas import Timedelta class TestAsUnit: def test_as_unit(self): td = Timedelta(days=1) assert td.as_unit("us") is td res = td.as_unit("ns") assert res._val...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/timedelta/methods/__init__.py
pandas/tests/scalar/timedelta/methods/__init__.py
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/interval/test_interval.py
pandas/tests/scalar/interval/test_interval.py
import numpy as np import pytest from pandas import ( Interval, Timedelta, Timestamp, ) @pytest.fixture def interval(): return Interval(0, 1) class TestInterval: def test_properties(self, interval): assert interval.closed == "right" assert interval.left == 0 assert inter...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/interval/test_overlaps.py
pandas/tests/scalar/interval/test_overlaps.py
import pytest from pandas import ( Interval, Timedelta, Timestamp, ) @pytest.fixture( params=[ (Timedelta("0 days"), Timedelta("1 day")), (Timestamp("2018-01-01"), Timedelta("1 day")), (0, 1), ], ids=lambda x: type(x[0]).__name__, ) def start_shift(request): """ ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/interval/test_constructors.py
pandas/tests/scalar/interval/test_constructors.py
import pytest from pandas import ( Interval, Period, Timestamp, ) class TestIntervalConstructors: @pytest.mark.parametrize( "left, right", [ ("a", "z"), (("a", "b"), ("c", "d")), (list("AB"), list("ab")), (Interval(0, 1), Interval(1, 2))...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/interval/test_formats.py
pandas/tests/scalar/interval/test_formats.py
from pandas import Interval def test_interval_repr(): interval = Interval(0, 1) assert repr(interval) == "Interval(0, 1, closed='right')" assert str(interval) == "(0, 1]" interval_left = Interval(0, 1, closed="left") assert repr(interval_left) == "Interval(0, 1, closed='left')" assert str(int...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/interval/__init__.py
pandas/tests/scalar/interval/__init__.py
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/interval/test_arithmetic.py
pandas/tests/scalar/interval/test_arithmetic.py
from datetime import timedelta import numpy as np import pytest from pandas import ( Interval, Timedelta, Timestamp, ) import pandas._testing as tm class TestIntervalArithmetic: def test_interval_add(self, closed): interval = Interval(0, 1, closed=closed) expected = Interval(1, 2, cl...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/scalar/interval/test_contains.py
pandas/tests/scalar/interval/test_contains.py
import pytest from pandas import ( Interval, Timedelta, Timestamp, ) class TestContains: def test_contains(self): interval = Interval(0, 1) assert 0.5 in interval assert 1 in interval assert 0 not in interval interval_both = Interval(0, 1, "both") asse...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/util/test_assert_attr_equal.py
pandas/tests/util/test_assert_attr_equal.py
from types import SimpleNamespace import pytest from pandas.core.dtypes.common import is_float import pandas._testing as tm def test_assert_attr_equal(nulls_fixture): obj = SimpleNamespace() obj.na_value = nulls_fixture tm.assert_attr_equal("na_value", obj, obj) def test_assert_attr_equal_different_n...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/util/test_validate_args.py
pandas/tests/util/test_validate_args.py
import pytest from pandas.util._validators import validate_args @pytest.fixture def _fname(): return "func" def test_bad_min_fname_arg_count(_fname): msg = "'max_fname_arg_count' must be non-negative" with pytest.raises(ValueError, match=msg): validate_args(_fname, (None,), -1, "foo") def te...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/util/test_assert_frame_equal.py
pandas/tests/util/test_assert_frame_equal.py
import numpy as np import pytest from pandas.errors import Pandas4Warning import pandas as pd from pandas import DataFrame import pandas._testing as tm @pytest.fixture(params=[True, False]) def by_blocks_fixture(request): return request.param def _assert_frame_equal_both(a, b, **kwargs): """ Check tha...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/util/test_assert_series_equal.py
pandas/tests/util/test_assert_series_equal.py
import numpy as np import pytest import pandas as pd from pandas import ( Categorical, DataFrame, Series, ) import pandas._testing as tm def _assert_series_equal_both(a, b, **kwargs): """ Check that two Series equal. This check is performed commutatively. Parameters ---------- a...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/util/test_assert_produces_warning.py
pandas/tests/util/test_assert_produces_warning.py
""" " Test module for testing ``pandas._testing.assert_produces_warning``. """ import warnings import pytest from pandas.errors import ( DtypeWarning, PerformanceWarning, ) import pandas._testing as tm @pytest.fixture( params=[ (RuntimeWarning, UserWarning), (UserWarning, FutureWarning...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/util/test_util.py
pandas/tests/util/test_util.py
import os import pytest from pandas import ( array, compat, ) import pandas._testing as tm def test_numpy_err_state_is_default(): expected = {"over": "warn", "divide": "warn", "invalid": "warn", "under": "ignore"} import numpy as np # The error state should be unchanged after that import. a...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/util/test_assert_extension_array_equal.py
pandas/tests/util/test_assert_extension_array_equal.py
import numpy as np import pytest from pandas import ( Timestamp, array, ) import pandas._testing as tm from pandas.core.arrays.sparse import SparseArray @pytest.mark.parametrize( "kwargs", [ {}, # Default is check_exact=False {"check_exact": False}, {"check_exact": True}, ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/util/test_deprecate_nonkeyword_arguments.py
pandas/tests/util/test_deprecate_nonkeyword_arguments.py
""" Tests for the `deprecate_nonkeyword_arguments` decorator """ import inspect from pandas.errors import _CurrentDeprecationWarning from pandas.util._decorators import deprecate_nonkeyword_arguments import pandas._testing as tm WARNING_CATEGORY = _CurrentDeprecationWarning @deprecate_nonkeyword_arguments( WA...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/util/test_doc.py
pandas/tests/util/test_doc.py
from textwrap import dedent from pandas.util._decorators import doc @doc(method="cumsum", operation="sum") def cumsum(whatever): """ This is the {method} method. It computes the cumulative {operation}. """ @doc( cumsum, dedent( """ Examples -------- >>> cum...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/util/test_assert_categorical_equal.py
pandas/tests/util/test_assert_categorical_equal.py
import pytest from pandas import Categorical import pandas._testing as tm @pytest.mark.parametrize("c", [None, [1, 2, 3, 4, 5]]) def test_categorical_equal(c): c = Categorical([1, 2, 3, 4], categories=c) tm.assert_categorical_equal(c, c) @pytest.mark.parametrize("check_category_order", [True, False]) def t...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/util/test_deprecate.py
pandas/tests/util/test_deprecate.py
from textwrap import dedent import pytest from pandas.util._decorators import deprecate import pandas._testing as tm def new_func(): """ This is the summary. The deprecate directive goes next. This is the extended summary. The deprecate directive goes before this. """ return "new_func called" ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/util/test_hashing.py
pandas/tests/util/test_hashing.py
import numpy as np import pytest import pandas as pd from pandas import ( DataFrame, Index, MultiIndex, Series, period_range, timedelta_range, ) import pandas._testing as tm from pandas.core.util.hashing import hash_tuples from pandas.util import ( hash_array, hash_pandas_object, ) @p...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/util/test_validate_args_and_kwargs.py
pandas/tests/util/test_validate_args_and_kwargs.py
import pytest from pandas.util._validators import validate_args_and_kwargs @pytest.fixture def _fname(): return "func" def test_invalid_total_length_max_length_one(_fname): compat_args = ("foo",) kwargs = {"foo": "FOO"} args = ("FoO", "BaZ") min_fname_arg_count = 0 max_length = len(compat_...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/util/conftest.py
pandas/tests/util/conftest.py
import pytest @pytest.fixture(params=[True, False]) def check_dtype(request): """ Fixture returning `True` or `False`, determining whether to check if the `dtype` is identical or not, when comparing two data structures, e.g. `Series`, `SparseArray` or `DataFrame`. """ return request.param @p...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/util/test_deprecate_kwarg.py
pandas/tests/util/test_deprecate_kwarg.py
import pytest from pandas.util._decorators import deprecate_kwarg import pandas._testing as tm @deprecate_kwarg(FutureWarning, "old", new_arg_name="new") def _f1(new=False): return new _f2_mappings = {"yes": True, "no": False} @deprecate_kwarg(FutureWarning, "old", new_arg_name="new", mapping=_f2_mappings) ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/util/test_validate_inclusive.py
pandas/tests/util/test_validate_inclusive.py
import numpy as np import pytest from pandas.util._validators import validate_inclusive import pandas as pd @pytest.mark.parametrize( "invalid_inclusive", ( "ccc", 2, object(), None, np.nan, pd.NA, pd.DataFrame(), ), ) def test_invalid_inclusive(in...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/util/test_assert_almost_equal.py
pandas/tests/util/test_assert_almost_equal.py
import numpy as np import pytest from pandas import ( NA, DataFrame, Index, NaT, Series, Timestamp, ) import pandas._testing as tm def _assert_almost_equal_both(a, b, **kwargs): """ Check that two objects are approximately equal. This check is performed commutatively. Parame...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/util/test_shares_memory.py
pandas/tests/util/test_shares_memory.py
import numpy as np import pandas.util._test_decorators as td import pandas as pd import pandas._testing as tm def test_shares_memory_interval(): obj = pd.interval_range(1, 5) assert tm.shares_memory(obj, obj) assert tm.shares_memory(obj, obj._data) assert tm.shares_memory(obj, obj[::-1]) assert...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/util/__init__.py
pandas/tests/util/__init__.py
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/util/test_show_versions.py
pandas/tests/util/test_show_versions.py
import json import os import re from pandas.util._print_versions import ( _get_dependency_info, _get_sys_info, ) import pandas as pd def test_show_versions(tmpdir): # GH39701 as_json = os.path.join(tmpdir, "test_output.json") pd.show_versions(as_json=as_json) with open(as_json, encoding="u...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/util/test_validate_kwargs.py
pandas/tests/util/test_validate_kwargs.py
import pytest from pandas.util._validators import ( validate_bool_kwarg, validate_kwargs, ) @pytest.fixture def _fname(): return "func" def test_bad_kwarg(_fname): good_arg = "f" bad_arg = good_arg + "o" compat_args = {good_arg: "foo", bad_arg + "o": "bar"} kwargs = {good_arg: "foo", b...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/util/test_assert_interval_array_equal.py
pandas/tests/util/test_assert_interval_array_equal.py
import pytest from pandas import ( Interval, interval_range, ) import pandas._testing as tm from pandas.arrays import IntervalArray @pytest.mark.parametrize( "kwargs", [ {"start": 0, "periods": 4}, {"start": 1, "periods": 5}, {"start": 5, "end": 10, "closed": "left"}, ], )...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/util/test_assert_index_equal.py
pandas/tests/util/test_assert_index_equal.py
import numpy as np import pytest from pandas import ( NA, Categorical, CategoricalIndex, Index, MultiIndex, NaT, RangeIndex, ) import pandas._testing as tm def test_index_equal_levels_mismatch(): msg = """Index are different Index levels are different \\[left\\]: 1, Index\\(\\[1, 2,...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/util/test_numba.py
pandas/tests/util/test_numba.py
import pytest import pandas.util._test_decorators as td from pandas import option_context @td.skip_if_installed("numba") def test_numba_not_installed_option_context(): with pytest.raises(ImportError, match="`Import numba` failed"): with option_context("compute.use_numba", True): pass
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/util/test_rewrite_warning.py
pandas/tests/util/test_rewrite_warning.py
import warnings import pytest from pandas.util._exceptions import rewrite_warning import pandas._testing as tm @pytest.mark.parametrize( "target_category, target_message, hit", [ (FutureWarning, "Target message", True), (FutureWarning, "Target", True), (FutureWarning, "get mess", Tr...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/util/test_assert_numpy_array_equal.py
pandas/tests/util/test_assert_numpy_array_equal.py
import copy import numpy as np import pytest import pandas as pd from pandas import Timestamp import pandas._testing as tm def test_assert_numpy_array_equal_shape_mismatch(): msg = """numpy array are different numpy array shapes are different \\[left\\]: \\(2L*,\\) \\[right\\]: \\(3L*,\\)""" with pytest....
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/test_string.py
pandas/tests/extension/test_string.py
""" This file contains a minimal set of tests for compliance with the extension array interface test suite, and should contain no other tests. The test suite for the full functionality of the array is located in `pandas/tests/arrays/`. The tests in this file are inherited from the BaseExtensionTests, and only minimal ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/test_sparse.py
pandas/tests/extension/test_sparse.py
""" This file contains a minimal set of tests for compliance with the extension array interface test suite, and should contain no other tests. The test suite for the full functionality of the array is located in `pandas/tests/arrays/`. The tests in this file are inherited from the BaseExtensionTests, and only minimal ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/test_datetime.py
pandas/tests/extension/test_datetime.py
""" This file contains a minimal set of tests for compliance with the extension array interface test suite, and should contain no other tests. The test suite for the full functionality of the array is located in `pandas/tests/arrays/`. The tests in this file are inherited from the BaseExtensionTests, and only minimal ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/test_interval.py
pandas/tests/extension/test_interval.py
""" This file contains a minimal set of tests for compliance with the extension array interface test suite, and should contain no other tests. The test suite for the full functionality of the array is located in `pandas/tests/arrays/`. The tests in this file are inherited from the BaseExtensionTests, and only minimal ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/test_common.py
pandas/tests/extension/test_common.py
import numpy as np import pytest from pandas.core.dtypes import dtypes from pandas.core.dtypes.common import is_extension_array_dtype import pandas as pd import pandas._testing as tm from pandas.core.arrays import ExtensionArray class DummyDtype(dtypes.ExtensionDtype): pass class DummyArray(ExtensionArray): ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/conftest.py
pandas/tests/extension/conftest.py
import operator import pytest from pandas import Series @pytest.fixture def dtype(): """A fixture providing the ExtensionDtype to validate.""" raise NotImplementedError @pytest.fixture def data(): """ Length-10 array for this type. * data[0] and data[1] should both be non missing * data[0...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/test_extension.py
pandas/tests/extension/test_extension.py
""" Tests for behavior if an author does *not* implement EA methods. """ import numpy as np import pytest from pandas.core.arrays import ExtensionArray class MyEA(ExtensionArray): def __init__(self, values) -> None: self._values = values @pytest.fixture def data(): arr = np.arange(10) return M...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/test_numpy.py
pandas/tests/extension/test_numpy.py
""" This file contains a minimal set of tests for compliance with the extension array interface test suite, and should contain no other tests. The test suite for the full functionality of the array is located in `pandas/tests/arrays/`. The tests in this file are inherited from the BaseExtensionTests, and only minimal ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/test_masked.py
pandas/tests/extension/test_masked.py
""" This file contains a minimal set of tests for compliance with the extension array interface test suite, and should contain no other tests. The test suite for the full functionality of the array is located in `pandas/tests/arrays/`. The tests in this file are inherited from the BaseExtensionTests, and only minimal ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/__init__.py
pandas/tests/extension/__init__.py
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/test_categorical.py
pandas/tests/extension/test_categorical.py
""" This file contains a minimal set of tests for compliance with the extension array interface test suite, and should contain no other tests. The test suite for the full functionality of the array is located in `pandas/tests/arrays/`. The tests in this file are inherited from the BaseExtensionTests, and only minimal ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/test_arrow.py
pandas/tests/extension/test_arrow.py
""" This file contains a minimal set of tests for compliance with the extension array interface test suite, and should contain no other tests. The test suite for the full functionality of the array is located in `pandas/tests/arrays/`. The tests in this file are inherited from the BaseExtensionTests, and only minimal t...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
true
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/test_period.py
pandas/tests/extension/test_period.py
""" This file contains a minimal set of tests for compliance with the extension array interface test suite, and should contain no other tests. The test suite for the full functionality of the array is located in `pandas/tests/arrays/`. The tests in this file are inherited from the BaseExtensionTests, and only minimal ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/base/printing.py
pandas/tests/extension/base/printing.py
import io import pytest import pandas as pd class BasePrintingTests: """Tests checking the formatting of your EA when printed.""" @pytest.mark.parametrize("size", ["big", "small"]) def test_array_repr(self, data, size): if size == "small": data = data[:5] else: d...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/base/reduce.py
pandas/tests/extension/base/reduce.py
from typing import final import pytest import pandas as pd import pandas._testing as tm class BaseReduceTests: """ Reduction specific tests. Generally these only make sense for numeric/boolean operations. """ def _supports_reduction(self, ser: pd.Series, op_name: str) -> bool: # Specify...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/base/constructors.py
pandas/tests/extension/base/constructors.py
import numpy as np import pytest import pandas as pd import pandas._testing as tm from pandas.api.extensions import ExtensionArray from pandas.core.internals.blocks import EABackedBlock class BaseConstructorsTests: def test_from_sequence_from_cls(self, data): result = type(data)._from_sequence(data, dtyp...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/base/ops.py
pandas/tests/extension/base/ops.py
from __future__ import annotations from typing import final import numpy as np import pytest from pandas.core.dtypes.common import is_string_dtype import pandas as pd import pandas._testing as tm from pandas.core import ops class BaseOpsUtil: series_scalar_exc: type[Exception] | None = TypeError frame_sca...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/base/dim2.py
pandas/tests/extension/base/dim2.py
""" Tests for 2D compatibility. """ import numpy as np import pytest from pandas._libs.missing import is_matching_na from pandas.core.dtypes.common import ( is_bool_dtype, is_integer_dtype, ) import pandas as pd import pandas._testing as tm from pandas.core.arrays.integer import NUMPY_INT_TO_DTYPE class D...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/base/missing.py
pandas/tests/extension/base/missing.py
import numpy as np import pytest import pandas as pd import pandas._testing as tm class BaseMissingTests: def test_isna(self, data_missing): expected = np.array([True, False]) result = pd.isna(data_missing) tm.assert_numpy_array_equal(result, expected) result = pd.Series(data_mi...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/base/interface.py
pandas/tests/extension/base/interface.py
import numpy as np import pytest from pandas.compat.numpy import np_version_gt2 from pandas.core.dtypes.cast import construct_1d_object_array_from_listlike from pandas.core.dtypes.common import is_extension_array_dtype from pandas.core.dtypes.dtypes import ExtensionDtype import pandas as pd import pandas._testing as...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/base/dtype.py
pandas/tests/extension/base/dtype.py
import numpy as np import pytest import pandas as pd import pandas._testing as tm from pandas.api.types import ( infer_dtype, is_object_dtype, is_string_dtype, ) class BaseDtypeTests: """Base class for ExtensionDtype classes""" def test_name(self, dtype): assert isinstance(dtype.name, st...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/base/setitem.py
pandas/tests/extension/base/setitem.py
import numpy as np import pytest from pandas.core.dtypes.common import is_hashable import pandas as pd import pandas._testing as tm class BaseSetitemTests: @pytest.fixture( params=[ lambda x: x.index, lambda x: list(x.index), lambda x: slice(None), lambda ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/base/__init__.py
pandas/tests/extension/base/__init__.py
""" Base test suite for extension arrays. These tests are intended for third-party libraries to subclass to validate that their extension arrays and dtypes satisfy the interface. Moving or renaming the tests should not be done lightly. Libraries are expected to implement a few pytest fixtures to provide data for the ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/base/accumulate.py
pandas/tests/extension/base/accumulate.py
import pytest import pandas as pd import pandas._testing as tm class BaseAccumulateTests: """ Accumulation specific tests. Generally these only make sense for numeric/boolean operations. """ def _supports_accumulation(self, ser: pd.Series, op_name: str) -> bool: # Do we expect this accum...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/base/reshaping.py
pandas/tests/extension/base/reshaping.py
import itertools import numpy as np import pytest from pandas.core.dtypes.dtypes import NumpyEADtype import pandas as pd import pandas._testing as tm from pandas.api.extensions import ExtensionArray from pandas.core.internals.blocks import EABackedBlock class BaseReshapingTests: """Tests for reshaping and conc...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/base/methods.py
pandas/tests/extension/base/methods.py
import inspect import operator import numpy as np import pytest from pandas._typing import Dtype from pandas.core.dtypes.common import is_bool_dtype from pandas.core.dtypes.dtypes import NumpyEADtype from pandas.core.dtypes.missing import na_value_for_dtype import pandas as pd import pandas._testing as tm from pand...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/base/base.py
pandas/tests/extension/base/base.py
class BaseExtensionTests: pass
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/base/groupby.py
pandas/tests/extension/base/groupby.py
import re import pytest from pandas.core.dtypes.common import ( is_bool_dtype, is_numeric_dtype, is_object_dtype, is_string_dtype, ) import pandas as pd import pandas._testing as tm @pytest.mark.filterwarnings( "ignore:The default of observed=False is deprecated:FutureWarning" ) class BaseGroup...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/base/io.py
pandas/tests/extension/base/io.py
from io import StringIO import numpy as np import pytest import pandas as pd import pandas._testing as tm from pandas.core.arrays import ExtensionArray class BaseParsingTests: @pytest.mark.parametrize("engine", ["c", "python"]) def test_EA_types(self, engine, data, request): if isinstance(data.dtype...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/base/getitem.py
pandas/tests/extension/base/getitem.py
import numpy as np import pytest import pandas as pd import pandas._testing as tm class BaseGetitemTests: """Tests for ExtensionArray.__getitem__.""" def test_iloc_series(self, data): ser = pd.Series(data) result = ser.iloc[:4] expected = pd.Series(data[:4]) tm.assert_series_...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/base/casting.py
pandas/tests/extension/base/casting.py
import numpy as np import pytest import pandas.util._test_decorators as td import pandas as pd import pandas._testing as tm from pandas.core.internals.blocks import NumpyBlock class BaseCastingTests: """Casting to and from ExtensionDtypes""" def test_astype_object_series(self, all_data): ser = pd.S...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/base/index.py
pandas/tests/extension/base/index.py
""" Tests for Indexes backed by arbitrary ExtensionArrays. """ import pandas as pd class BaseIndexTests: """Tests for Index object backed by an ExtensionArray""" def test_index_from_array(self, data): idx = pd.Index(data) assert data.dtype == idx.dtype def test_index_from_listlike_with_...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/date/array.py
pandas/tests/extension/date/array.py
from __future__ import annotations import datetime as dt from typing import ( TYPE_CHECKING, Any, cast, ) import numpy as np from pandas.core.dtypes.dtypes import register_extension_dtype from pandas.api.extensions import ( ExtensionArray, ExtensionDtype, ) from pandas.api.types import pandas_dt...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/date/__init__.py
pandas/tests/extension/date/__init__.py
from pandas.tests.extension.date.array import ( DateArray, DateDtype, ) __all__ = ["DateArray", "DateDtype"]
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/list/test_list.py
pandas/tests/extension/list/test_list.py
import pytest import pandas as pd from pandas.tests.extension.list.array import ( ListArray, ListDtype, make_data, ) @pytest.fixture def dtype(): return ListDtype() @pytest.fixture def data(): """Length-10 ListArray for semantics test.""" data = make_data(10) while len(data[0]) == len(...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/list/array.py
pandas/tests/extension/list/array.py
""" Test extension array for storing nested data in a pandas container. The ListArray stores an ndarray of lists. """ from __future__ import annotations import numbers import string from typing import TYPE_CHECKING import numpy as np from pandas.core.dtypes.base import ExtensionDtype import pandas as pd from pand...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/list/__init__.py
pandas/tests/extension/list/__init__.py
from pandas.tests.extension.list.array import ( ListArray, ListDtype, make_data, ) __all__ = ["ListArray", "ListDtype", "make_data"]
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/json/test_json.py
pandas/tests/extension/json/test_json.py
import collections import operator import sys import numpy as np import pytest import pandas as pd import pandas._testing as tm from pandas.tests.extension import base from pandas.tests.extension.json.array import ( JSONArray, JSONDtype, make_data, ) # We intentionally don't run base.BaseSetitemTests bec...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/json/array.py
pandas/tests/extension/json/array.py
""" Test extension array for storing nested data in a pandas container. The JSONArray stores lists of dictionaries. The storage mechanism is a list, not an ndarray. Note ---- We currently store lists of UserDicts. Pandas has a few places internally that specifically check for dicts, and does non-scalar things in that...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/json/__init__.py
pandas/tests/extension/json/__init__.py
from pandas.tests.extension.json.array import ( JSONArray, JSONDtype, make_data, ) __all__ = ["JSONArray", "JSONDtype", "make_data"]
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/decimal/test_decimal.py
pandas/tests/extension/decimal/test_decimal.py
from __future__ import annotations import decimal import numpy as np import pytest from pandas.errors import Pandas4Warning import pandas as pd import pandas._testing as tm from pandas.tests.extension import base from pandas.tests.extension.decimal.array import ( DecimalArray, DecimalDtype, make_data, ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/decimal/array.py
pandas/tests/extension/decimal/array.py
from __future__ import annotations import decimal import numbers import sys from typing import TYPE_CHECKING import numpy as np from pandas.core.dtypes.base import ExtensionDtype from pandas.core.dtypes.common import ( is_dtype_equal, is_float, is_integer, pandas_dtype, ) import pandas as pd from pa...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/decimal/__init__.py
pandas/tests/extension/decimal/__init__.py
from pandas.tests.extension.decimal.array import ( DecimalArray, DecimalDtype, make_data, to_decimal, ) __all__ = ["DecimalArray", "DecimalDtype", "make_data", "to_decimal"]
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/array_with_attr/array.py
pandas/tests/extension/array_with_attr/array.py
""" Test extension array that has custom attribute information (not stored on the dtype). """ from __future__ import annotations import numbers from typing import TYPE_CHECKING import numpy as np from pandas.core.dtypes.base import ExtensionDtype import pandas as pd from pandas.core.arrays import ExtensionArray ...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/array_with_attr/__init__.py
pandas/tests/extension/array_with_attr/__init__.py
from pandas.tests.extension.array_with_attr.array import ( FloatAttrArray, FloatAttrDtype, ) __all__ = ["FloatAttrArray", "FloatAttrDtype"]
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/extension/array_with_attr/test_array_with_attr.py
pandas/tests/extension/array_with_attr/test_array_with_attr.py
import numpy as np import pandas as pd import pandas._testing as tm from pandas.tests.extension.array_with_attr import FloatAttrArray def test_concat_with_all_na(): # https://github.com/pandas-dev/pandas/pull/47762 # ensure that attribute of the column array is preserved (when it gets # preserved in rein...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/construction/test_extract_array.py
pandas/tests/construction/test_extract_array.py
from pandas import Index import pandas._testing as tm from pandas.core.construction import extract_array def test_extract_array_rangeindex(): ri = Index(range(5)) expected = ri._values res = extract_array(ri, extract_numpy=True, extract_range=True) tm.assert_numpy_array_equal(res, expected) res =...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/construction/__init__.py
pandas/tests/construction/__init__.py
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/tools/test_to_datetime.py
pandas/tests/tools/test_to_datetime.py
"""test to_datetime""" import calendar from collections import deque from datetime import ( date, datetime, timedelta, timezone, ) from decimal import Decimal import locale import zoneinfo from dateutil.parser import parse import numpy as np import pytest from pandas._libs import tslib from pandas._l...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
true
pandas-dev/pandas
https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/tests/tools/test_to_timedelta.py
pandas/tests/tools/test_to_timedelta.py
from datetime import ( time, timedelta, ) import numpy as np import pytest from pandas.compat import ( IS64, WASM, ) from pandas.errors import ( OutOfBoundsTimedelta, Pandas4Warning, ) import pandas as pd from pandas import ( Series, TimedeltaIndex, isna, to_timedelta, ) impor...
python
BSD-3-Clause
91514c363604506f447e53380d3aa00520f1037b
2026-01-04T14:39:36.002480Z
false