Closed
Description
(dev-3.9) ➜ python-db-dtypes-pandas git:(issue28-NDArrayBacked2DTests) ✗ nox -s unit_prerelease
nox > Running session unit_prerelease
nox > Creating virtual environment (virtualenv) using python3.10 in .nox/unit_prerelease
nox > python -m pip install --extra-index-url https://pypi.fury.io/arrow-nightlies/ --prefer-binary --pre --upgrade pyarrow
nox > python -m pip install --extra-index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple --prefer-binary --pre --upgrade pandas
nox > python -m pip install mock asyncmock pytest pytest-cov pytest-asyncio -c /Users/swast/src/github.com/googleapis/python-db-dtypes-pandas/testing/constraints-3.10.txt
nox > python -m pip install packaging pandas pyarrow numpy
nox > python -m pip install --no-deps -e .
nox > python -m pip freeze
asyncmock==0.4.2
attrs==21.4.0
coverage==6.3.2
-e git+ssh://git@github.com/googleapis/python-db-dtypes-pandas.git@d9edc063393c4431cb8622106c7999afea5f8532#egg=db_dtypes
iniconfig==1.1.1
mock==4.0.3
numpy==1.22.3
packaging==21.3
pandas==1.5.0.dev0+526.g48d515958d
pluggy==1.0.0
py==1.11.0
pyarrow==8.0.0.dev229
pyparsing==3.0.7
pytest==7.1.0
pytest-asyncio==0.18.2
pytest-cov==3.0.0
python-dateutil==2.8.2
pytz==2021.3
six==1.16.0
tomli==2.0.1
nox > py.test --quiet --junitxml=prerelease_unit_3.10_sponge_log.xml --cov=db_dtypes --cov=tests/unit --cov-append --cov-config=.coveragerc --cov-report= --cov-fail-under=0 tests/unit
......................................................................................................................... [ 49%]
......FF................................................................................................................. [ 98%]
.... [100%]
=========================================================== FAILURES ============================================================
_________________________________________________ test__from_factorized[dbdate] _________________________________________________
dtype = 'dbdate'
@for_date_and_time
def test__from_factorized(dtype):
sample_values = SAMPLE_VALUES[dtype]
a = _cls(dtype)(sample_values * 2)
> codes, b = a.factorize()
tests/unit/test_dtypes.py:296:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.nox/unit_prerelease/lib/python3.10/site-packages/pandas/core/arrays/base.py:1044: in factorize
arr, na_value = self._values_for_factorize()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <DateArray>
[datetime.date(2021, 2, 2), datetime.date(2021, 2, 3),
datetime.date(2021, 2, 4), datetime.date(2021, 2, ...2021, 2, 2), datetime.date(2021, 2, 3),
datetime.date(2021, 2, 4), datetime.date(2021, 2, 5)]
Length: 8, dtype: dbdate
def _values_for_factorize(self):
> return self._ndarray, self._internal_fill_value
E AttributeError: 'DateArray' object has no attribute '_internal_fill_value'
.nox/unit_prerelease/lib/python3.10/site-packages/pandas/core/arrays/_mixins.py:194: AttributeError
_________________________________________________ test__from_factorized[dbtime] _________________________________________________
dtype = 'dbtime'
@for_date_and_time
def test__from_factorized(dtype):
sample_values = SAMPLE_VALUES[dtype]
a = _cls(dtype)(sample_values * 2)
> codes, b = a.factorize()
tests/unit/test_dtypes.py:296:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.nox/unit_prerelease/lib/python3.10/site-packages/pandas/core/arrays/base.py:1044: in factorize
arr, na_value = self._values_for_factorize()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <TimeArray>
[ datetime.time(1, 2, 2), datetime.time(1, 2, 3, 500000),
datetime.time(1, 2, 4, 500000), datetime...tetime.time(1, 2, 3, 500000),
datetime.time(1, 2, 4, 500000), datetime.time(1, 2, 5, 500000)]
Length: 8, dtype: dbtime
def _values_for_factorize(self):
> return self._ndarray, self._internal_fill_value
E AttributeError: 'TimeArray' object has no attribute '_internal_fill_value'
.nox/unit_prerelease/lib/python3.10/site-packages/pandas/core/arrays/_mixins.py:194: AttributeError
======================================================= warnings summary ========================================================
.nox/unit_prerelease/lib/python3.10/site-packages/pytest_asyncio/plugin.py:191
/Users/swast/src/github.com/googleapis/python-db-dtypes-pandas/.nox/unit_prerelease/lib/python3.10/site-packages/pytest_asyncio/plugin.py:191: DeprecationWarning: The 'asyncio_mode' default value will change to 'strict' in future, please explicitly use 'asyncio_mode=strict' or 'asyncio_mode=auto' in pytest configuration file.
config.issue_config_time_warning(LEGACY_MODE, stacklevel=2)
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
---- generated xml file: /Users/swast/src/github.com/googleapis/python-db-dtypes-pandas/prerelease_unit_3.10_sponge_log.xml -----
==================================================== short test summary info ====================================================
FAILED tests/unit/test_dtypes.py::test__from_factorized[dbdate] - AttributeError: 'DateArray' object has no attribute '_intern...
FAILED tests/unit/test_dtypes.py::test__from_factorized[dbtime] - AttributeError: 'TimeArray' object has no attribute '_intern...