[PyCharm Tables] PY-80834 Fixed test data and tests

(cherry picked from commit c1c344c53e2ec1ad91e423f59c4f062c25678f39)

IJ-CR-166515

GitOrigin-RevId: 152abd4bbb6df85b9fa3a373f8992898864348e8
This commit is contained in:
Natalia.Murycheva
2025-06-19 22:16:10 +02:00
committed by intellij-monorepo-bot
parent efc74aaa70
commit 0e20868e92
3 changed files with 17 additions and 11 deletions

View File

@@ -1,8 +1,8 @@
{'count': 4.0, 'mean': 1.0, 'std': 0.0, 'min': 1.0, '5%': 1.0, '25%': 1.0, '50%': 1.0, '75%': 1.0, '95%': 1.0, 'max': 1.0}
{'count': 4, 'unique': 1, 'top': 'foo', 'freq': 4}
{'count': 0, 'unique': 0, 'top': nan, 'freq': nan}
{'count': 4}
{'count': 4}
{'count': 3, 'unique': 3, 'top': 'bar', 'freq': 1}
{'count': 3, 'unique': 3, 'top': 'bar', 'freq': 1}
{'count': 4, 'unique': 2, 'top': True, 'freq': 2}
@@ -17,4 +17,7 @@
{'count': 4, 'unique': 4, 'top': 'A', 'freq': 1}
{'count': 4, 'unique': 3, 'top': [1, 2], 'freq': 2}
{'count': 4, 'unique': 3, 'top': {1: 2}, 'freq': 2}
{'count': 4, 'unique': 3, 'top': (1, 2), 'freq': 2}
{'count': 4, 'unique': 3, 'top': (1, 2), 'freq': 2}
{'count': 4}
{'count': 4}
{'count': 4}

View File

@@ -1,8 +1,8 @@
{'count': 4.0, 'mean': 1.0, 'std': 0.0, 'min': 1.0, '5%': 1.0, '25%': 1.0, '50%': 1.0, '75%': 1.0, '95%': 1.0, 'max': 1.0}
{'count': 4, 'unique': 1, 'top': 'foo', 'freq': 4}
{'count': 0, 'unique': 0, 'top': nan, 'freq': nan}
{'count': (4+0j), 'mean': (1+20j), 'std': (nan+0j), 'min': (1+20j), '5%': (1+20j), '25%': (1+20j), '50%': (1+20j), '75%': (1+20j), '95%': (1+20j), 'max': (1+20j)}
{'count': (4+0j), 'mean': (1+20j), 'std': (nan+0j), 'min': (1+20j), '5%': (1+20j), '25%': (1+20j), '50%': (1+20j), '75%': (1+20j), '95%': (1+20j), 'max': (1+20j)}
{'count': 4}
{'count': 4}
{'count': 3, 'unique': 3, 'top': 'bar', 'freq': 1}
{'count': 3, 'unique': 3, 'top': 'bar', 'freq': 1}
{'count': 4, 'unique': 2, 'top': True, 'freq': 2}
@@ -15,6 +15,6 @@
{'count': 4, 'mean': Timestamp('2013-01-02 12:00:00+0100', tz='CET'), 'min': Timestamp('2013-01-01 00:00:00+0100', tz='CET'), '5%': Timestamp('2013-01-01 03:36:00+0100', tz='CET'), '25%': Timestamp('2013-01-01 18:00:00+0100', tz='CET'), '50%': Timestamp('2013-01-02 12:00:00+0100', tz='CET'), '75%': Timestamp('2013-01-03 06:00:00+0100', tz='CET'), '95%': Timestamp('2013-01-03 20:24:00+0100', tz='CET'), 'max': Timestamp('2013-01-04 00:00:00+0100', tz='CET')}
{'count': 4, 'unique': 1, 'top': Period('2012-01-01', 'D'), 'freq': 4}
{'count': 4, 'unique': 4, 'top': 'A', 'freq': 1}
{'count': 4, 'unique': 3, 'top': [1, 2], 'freq': 2}
{'count': 4, 'unique': 3, 'top': {1: 2}, 'freq': 2}
{'count': 4, 'unique': 3, 'top': (1, 2), 'freq': 2}
{'count': 4}
{'count': 4}
{'count': 4}

View File

@@ -343,8 +343,8 @@ def test_describe_shape_all_types(setup_dataframe):
assert describe_df.shape[0] == 13
# the number of columns should be the same
assert describe_df.shape[1] == df.shape[1]
# check that we excluded only 2 columns from describe
assert len(describe_df.columns[describe_df.isna().all()].tolist()) == 2
# check that we don't exclude any column from the describe function
assert len(describe_df.columns[describe_df.isna().all()].tolist()) == 0
# 11
@@ -403,7 +403,10 @@ def test_describe_series(setup_dataframe):
reason="The exception will be raised during df creation in Python2")
def test_overflow_error_is_caught(setup_df_with_big_int_values):
df = setup_df_with_big_int_values
assert pandas_tables_helpers.__get_describe(df) is None
actual_result = pandas_tables_helpers.__get_describe(df)
assert actual_result is not None
expected_result = pd.Series(data={"count": 2}, index=["count"], name="BitIntValues")
assert (actual_result.values == expected_result.values).all()
# 15