Skip to content

tests.compliance.date.test_date_compliance.TestMethods: test_diff[-2] failed #183

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
flaky-bot bot opened this issue Apr 4, 2023 · 1 comment · Fixed by #189
Closed

tests.compliance.date.test_date_compliance.TestMethods: test_diff[-2] failed #183

flaky-bot bot opened this issue Apr 4, 2023 · 1 comment · Fixed by #189
Labels
api: bigquery Issues related to the googleapis/python-db-dtypes-pandas API. flakybot: flaky Tells the Flaky Bot not to close or comment on this issue. flakybot: issue An issue filed by the Flaky Bot. Should not be added manually. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@flaky-bot
Copy link

flaky-bot bot commented Apr 4, 2023

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and
I will stop commenting.


commit: 4161b81
buildURL: Build Status, Sponge
status: failed

Test output
self = 
data = 
[datetime.date(1900, 1, 1), datetime.date(1902, 1, 2),
 datetime.date(1904, 1, 3), datetime.date(1906, 1, 3),
 datetime.date(1908, 1, 4)]
Length: 5, dtype: dbdate
periods = -2
@pytest.mark.parametrize("periods", [1, -2])
def test_diff(self, data, periods):
    data = data[:5]
    if is_bool_dtype(data.dtype):
        op = operator.xor
    else:
        op = operator.sub
    try:
        # does this array implement ops?
        op(data, data)
    except Exception:
        pytest.skip(f"{type(data)} does not support diff")
    s = pd.Series(data)
    result = s.diff(periods)
    expected = pd.Series(op(data, data.shift(periods)))
    self.assert_series_equal(result, expected)

    df = pd.DataFrame({"A": data, "B": [1.0] * 5})
  result = df.diff(periods)

.nox/compliance_prerelease/lib/python3.11/site-packages/pandas/tests/extension/base/methods.py:389:


.nox/compliance_prerelease/lib/python3.11/site-packages/pandas/core/frame.py:9471: in diff
new_data = self._mgr.diff(n=periods, axis=axis)
.nox/compliance_prerelease/lib/python3.11/site-packages/pandas/core/internals/managers.py:415: in diff
return self.apply("diff", n=n, axis=axis)
.nox/compliance_prerelease/lib/python3.11/site-packages/pandas/core/internals/managers.py:353: in apply
applied = getattr(b, f)(**kwargs)
.nox/compliance_prerelease/lib/python3.11/site-packages/pandas/core/internals/blocks.py:2042: in diff
return [self.make_block(values=new_values)]
.nox/compliance_prerelease/lib/python3.11/site-packages/pandas/core/internals/blocks.py:228: in make_block
return new_block(values, placement=placement, ndim=self.ndim, refs=refs)


values = array([[-126316800000000000, -126316800000000000, -126316800000000000,
'NaT', 'NaT']],
dtype='timedelta64[ns]')
placement = BlockPlacement(slice(0, 1, 1))

def new_block(
    values,
    placement: BlockPlacement,
    *,
    ndim: int,
    refs: BlockValuesRefs | None = None,
) -> Block:
    # caller is responsible for ensuring:
    # - values is NOT a PandasArray
    # - check_ndim/ensure_block_shape already checked
    # - maybe_coerce_values already called/unnecessary
    klass = get_block_type(values.dtype)
  return klass(values, ndim=ndim, placement=placement, refs=refs)

E TypeError: Argument 'values' has incorrect type (expected pandas._libs.arrays.NDArrayBacked, got numpy.ndarray)

.nox/compliance_prerelease/lib/python3.11/site-packages/pandas/core/internals/blocks.py:2392: TypeError

@flaky-bot flaky-bot bot added flakybot: issue An issue filed by the Flaky Bot. Should not be added manually. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Apr 4, 2023
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-db-dtypes-pandas API. label Apr 4, 2023
@chalmerlowe chalmerlowe added priority: p2 Moderately-important priority. Fix may not be included in next release. and removed priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. labels Apr 4, 2023
@flaky-bot flaky-bot bot added the flakybot: flaky Tells the Flaky Bot not to close or comment on this issue. label Apr 5, 2023
@flaky-bot
Copy link
Author

flaky-bot bot commented Apr 5, 2023

Looks like this issue is flaky. 😟

I'm going to leave this open and stop commenting.

A human should fix and close this.


When run at the same commit (4161b81), this test passed in one build (Build Status, Sponge) and failed in another build (Build Status, Sponge).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-db-dtypes-pandas API. flakybot: flaky Tells the Flaky Bot not to close or comment on this issue. flakybot: issue An issue filed by the Flaky Bot. Should not be added manually. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant