repo_id stringclasses 400
values | cross_repo_split stringclasses 1
value | commit_index int32 0 1.19k | commit_sha stringlengths 40 40 | in_repo_split stringclasses 3
values | test_file stringlengths 7 121 | file_split stringclasses 3
values | split_group stringlengths 18 150 | lineno int32 1 5.24k | col_offset int32 0 165 | assertion_type stringclasses 35
values | test_function stringlengths 0 141 | prefix large_stringlengths 7 258k | target stringlengths 1 29.2k | assertion_event_type stringclasses 2
values | assertion_event_id stringlengths 64 64 | assertion_anchor large_stringlengths 14 176k | old_target stringlengths 1 11.2k ⌀ | old_lineno int32 2 4.91k ⌀ | old_col_offset int32 0 165 ⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
unionai-oss/pandera | train | 201 | 5aa77957615720741dd817b668154e9a72cf6c73 | train | tests/core/test_dtypes.py | train | unionai-oss/pandera:tests/core/test_dtypes.py | 513 | 8 | assert | test_inferred_dtype | """Tests a variety of python and pandas dtypes, and tests some specific
coercion examples."""
# pylint doesn't know about __init__ generated with dataclass
# pylint:disable=unexpected-keyword-arg,no-value-for-parameter
import dataclasses
import datetime
import inspect
from decimal import Decimal
from typing import Any,... | actual_dtype.check(inferred_datatype) | modified | 918a13e22ab9dbe5e116227334fc63be8f52780a814721671da163eb5cdbf096 | assert|test_inferred_dtype|"""Tests a variety of python and pandas dtypes, and tests some specific coercion examples.""" # pylint doesn't know about __init__ generated with dataclass # pylint:disable=unexpected-keyword-arg,no-value-for-parameter import dataclasses import datetime import inspect from decimal import Deci... | actual_dtype.check(inferred_datatype) | 513 | 8 |
unionai-oss/pandera | train | 201 | 5aa77957615720741dd817b668154e9a72cf6c73 | train | tests/core/test_model.py | train | unionai-oss/pandera:tests/core/test_model.py | 1,218 | 9 | pytest.raises | test_generic_optional_field | """Tests schema creation and validation from type annotations."""
# pylint:disable=missing-class-docstring,missing-function-docstring,too-few-public-methods
import re
from copy import deepcopy
from typing import Any, Generic, Iterable, Optional, TypeVar
import pandas as pd
import pytest
import pandera as pa
import pa... | SchemaError) | modified | 8de176591829b84d5af5461e7009b663c8b5838027c0cf9dc83ee62b629293b1 | pytest.raises|test_generic_optional_field|"""Tests schema creation and validation from type annotations.""" # pylint:disable=missing-class-docstring,missing-function-docstring,too-few-public-methods import re from copy import deepcopy from typing import Any, Generic, Iterable, Optional, TypeVar import pandas as pd impo... | SchemaError) | 1,218 | 9 |
unionai-oss/pandera | train | 201 | 5aa77957615720741dd817b668154e9a72cf6c73 | train | tests/core/test_pandas_accessor.py | train | unionai-oss/pandera:tests/core/test_pandas_accessor.py | 53 | 9 | pytest.raises | test_dataframe_series_add_schema | """Unit tests for pandas_accessor module."""
from typing import Union
from unittest.mock import patch
import pandas as pd
import pytest
import pandera as pa
@pytest.mark.parametrize(
"schema1, schema2, data, invalid_data",
[
[
pa.DataFrameSchema({"col": pa.Column(int)}, coerce=True),
... | TypeError, match=f"expected pd.{type(data).__name__}") | modified | 489599e4ac500a91eaf9191efa3f8ba8293b539dff99ad8b9fcaf03a801e929a | pytest.raises|test_dataframe_series_add_schema|"""Unit tests for pandas_accessor module.""" from typing import Union from unittest.mock import patch import pandas as pd import pytest import pandera as pa @pytest.mark.parametrize( "schema1, schema2, data, invalid_data", [ [ pa.DataFrameSchema({"col": pa.Column(int)}, co... | TypeError, match=f"expected pd.{type(data).__name__}") | 53 | 9 |
unionai-oss/pandera | train | 201 | 5aa77957615720741dd817b668154e9a72cf6c73 | train | tests/core/test_schema_inference.py | val | unionai-oss/pandera:tests/core/test_schema_inference.py | 79 | 8 | assert | test_infer_dataframe_schema | # pylint: disable=W0212
"""Unit tests for schema inference module."""
from typing import Type, Union
import pandas as pd
import pytest
import pandera as pa
from pandera import schema_inference
def _create_dataframe(
multi_index: bool = False, nullable: bool = False
) -> pd.DataFrame:
if multi_index:
... | isinstance(schema.index, pa.MultiIndex) | modified | 18821afaf6ffd6a83d088926c0945ea39417aa13c5b2e9270468eb88de2ba825 | assert|test_infer_dataframe_schema|# pylint: disable=W0212 """Unit tests for schema inference module.""" from typing import Type, Union import pandas as pd import pytest import pandera as pa from pandera import schema_inference def _create_dataframe( multi_index: bool = False, nullable: bool = False ) -> pd.DataFrame: ... | isinstance(schema.index, pa.MultiIndex) | 79 | 8 |
unionai-oss/pandera | train | 201 | 5aa77957615720741dd817b668154e9a72cf6c73 | train | tests/core/test_schemas.py | test | unionai-oss/pandera:tests/core/test_schemas.py | 1,034 | 4 | assert | test_select_columns | """Testing creation and manipulation of DataFrameSchema objects."""
# pylint: disable=too-many-lines,redefined-outer-name
import copy
from datetime import datetime, timedelta
from functools import partial
from typing import Any, Callable, Dict, List, Tuple, Type, Union
import numpy as np
import pandas as pd
import py... | all(x in select_columns for x in schema_selected.columns) | modified | 5d3da1d07e994bbed9950efd4d1fe9d3c2e8e5662cce9af333f1f4193c1f0821 | assert|test_select_columns|"""Testing creation and manipulation of DataFrameSchema objects.""" # pylint: disable=too-many-lines,redefined-outer-name import copy from datetime import datetime, timedelta from functools import partial from typing import Any, Callable, Dict, List, Tuple, Type, Union import numpy as np impo... | all(x in select_columns for x in schema_selected.columns) | 1,034 | 4 |
unionai-oss/pandera | train | 201 | 5aa77957615720741dd817b668154e9a72cf6c73 | train | tests/core/test_typing.py | val | unionai-oss/pandera:tests/core/test_typing.py | 392 | 13 | pytest.raises | test_pandas_extension_dtype_redundant_field | """Test typing annotations for the model api."""
# pylint:disable=missing-class-docstring,too-few-public-methods
import re
from typing import Any, Dict, Optional, Type
import numpy as np
import pandas as pd
import pytest
import pandera as pa
from pandera.dtypes import DataType
from pandera.typing import DataFrame, In... | TypeError, match=err_msg) | modified | 7c94b0075ad5ef8610269ca8dfff9f20c56be9231345cefa9d03e98a8a87ea00 | pytest.raises|test_pandas_extension_dtype_redundant_field|"""Test typing annotations for the model api.""" # pylint:disable=missing-class-docstring,too-few-public-methods import re from typing import Any, Dict, Optional, Type import numpy as np import pandas as pd import pytest import pandera as pa from pandera.dtypes ... | TypeError, match=err_msg) | 392 | 13 |
unionai-oss/pandera | train | 201 | 5aa77957615720741dd817b668154e9a72cf6c73 | train | tests/dask/test_dask.py | train | unionai-oss/pandera:tests/dask/test_dask.py | 147 | 9 | pytest.raises | test_init_pandas_dataframe_errors | """ Tests that basic Pandera functionality works for Dask objects. """
from typing import cast
import dask.dataframe as dd
import pandas as pd
import pytest
import pandera as pa
from pandera.typing.dask import DataFrame, Index, Series
class IntSchema(pa.SchemaModel): # pylint: disable=missing-class-docstring
... | pa.errors.SchemaError) | modified | 4c5ccafbdfd9664726d6810de210bc956588267acff1ace73946858201df376e | pytest.raises|test_init_pandas_dataframe_errors|""" Tests that basic Pandera functionality works for Dask objects. """ from typing import cast import dask.dataframe as dd import pandas as pd import pytest import pandera as pa from pandera.typing.dask import DataFrame, Index, Series class IntSchema(pa.SchemaModel): # py... | pa.errors.SchemaError) | 147 | 9 |
unionai-oss/pandera | train | 201 | 5aa77957615720741dd817b668154e9a72cf6c73 | train | tests/pyspark/test_schemas_on_pyspark.py | val | unionai-oss/pandera:tests/pyspark/test_schemas_on_pyspark.py | 681 | 4 | assert | test_init_pyspark_pandas_dataframe | """Test pandera on pyspark data structures."""
import re
import typing
from unittest.mock import MagicMock
import pandas as pd
import pyspark.pandas as ps
import pytest
from pyspark import SparkContext
import pandera as pa
from pandera import dtypes, extensions, system
from pandera.engines import numpy_engine, pandas... | isinstance( DataFrame[InitSchema]({"col1": [1], "col2": [1.0], "col3": ["1"]}), DataFrame, ) | modified | c4b55ca50ded0c50f90f25170006fc944f1529c449970ec0a8cf436acb4d8618 | assert|test_init_pyspark_pandas_dataframe|"""Test pandera on pyspark data structures.""" import re import typing from unittest.mock import MagicMock import pandas as pd import pyspark.pandas as ps import pytest from pyspark import SparkContext import pandera as pa from pandera import dtypes, extensions, system from pan... | isinstance( DataFrame[InitSchema]({"col1": [1], "col2": [1.0], "col3": ["1"]}), DataFrame, ) | 681 | 4 |
unionai-oss/pandera | train | 202 | 8ccede9af865e578138e23cbf183b345ecd1227e | train | tests/core/test_decorators.py | train | unionai-oss/pandera:tests/core/test_decorators.py | 921 | 9 | pytest.raises | test_check_types_union_args | """Testing the Decorators that check a functions input or output."""
import typing
from asyncio import AbstractEventLoop
import numpy as np
import pandas as pd
import pytest
from pandera import (
Check,
Column,
DataFrameSchema,
DateTime,
Field,
Float,
Int,
SchemaModel,
String,
... | errors.SchemaErrors) | modified | 5a1136d6cf62b6acfa9cad53e9e45e4bb0827913df13c3486fe8c20062c01c3a | pytest.raises|test_check_types_union_args|"""Testing the Decorators that check a functions input or output.""" import typing from asyncio import AbstractEventLoop import numpy as np import pandas as pd import pytest from pandera import ( Check, Column, DataFrameSchema, DateTime, Field, Float, Int, SchemaModel, String, ... | errors.SchemaErrors) | 921 | 9 |
unionai-oss/pandera | train | 202 | 8ccede9af865e578138e23cbf183b345ecd1227e | train | tests/core/test_decorators.py | train | unionai-oss/pandera:tests/core/test_decorators.py | 941 | 4 | assert | test_check_types_non_dataframes | """Testing the Decorators that check a functions input or output."""
import typing
from asyncio import AbstractEventLoop
import numpy as np
import pandas as pd
import pytest
from pandera import (
Check,
Column,
DataFrameSchema,
DateTime,
Field,
Float,
Int,
SchemaModel,
String,
... | isinstance(int_val, int) | modified | 854098442a9839a04c35dcf47ab311577b30dc1c90efe2330f895fbde9e5479d | assert|test_check_types_non_dataframes|"""Testing the Decorators that check a functions input or output.""" import typing from asyncio import AbstractEventLoop import numpy as np import pandas as pd import pytest from pandera import ( Check, Column, DataFrameSchema, DateTime, Field, Float, Int, SchemaModel, String, che... | isinstance(int_val, int) | 941 | 4 |
unionai-oss/pandera | train | 202 | 8ccede9af865e578138e23cbf183b345ecd1227e | train | tests/core/test_logical_dtypes.py | train | unionai-oss/pandera:tests/core/test_logical_dtypes.py | 225 | 9 | pytest.raises | test_invalid_decimal_params | """Tests logical dtypes."""
from datetime import date, datetime
from decimal import Decimal
from types import ModuleType
from typing import Any, Generator, Iterable, List, cast
import numpy as np
import pandas as pd
import pytest
from pandas.testing import assert_series_equal
import pandera as pa
from pandera.engine... | ValueError) | modified | d47c44aa6f5bf93f0ca11d38867492b708f925b7efd4c58db4839fff341f6bbe | pytest.raises|test_invalid_decimal_params|"""Tests logical dtypes.""" from datetime import date, datetime from decimal import Decimal from types import ModuleType from typing import Any, Generator, Iterable, List, cast import numpy as np import pandas as pd import pytest from pandas.testing import assert_series_equal i... | ValueError) | 224 | 9 |
unionai-oss/pandera | train | 202 | 8ccede9af865e578138e23cbf183b345ecd1227e | train | tests/core/test_logical_dtypes.py | train | unionai-oss/pandera:tests/core/test_logical_dtypes.py | 243 | 4 | assert | test_decimal_scale_zero | """Tests logical dtypes."""
from datetime import date, datetime
from decimal import Decimal
from types import ModuleType
from typing import Any, Generator, Iterable, List, cast
import numpy as np
import pandas as pd
import pytest
from pandas.testing import assert_series_equal
import pandera as pa
from pandera.engine... | result.all() | modified | 0fc252c29bef0376eb2698a2bd1e21b5594f9b90676c1c1625b885bf7e06545e | assert|test_decimal_scale_zero|"""Tests logical dtypes.""" from datetime import date, datetime from decimal import Decimal from types import ModuleType from typing import Any, Generator, Iterable, List, cast import numpy as np import pandas as pd import pytest from pandas.testing import assert_series_equal import pande... | result.all() | 242 | 4 |
unionai-oss/pandera | train | 202 | 8ccede9af865e578138e23cbf183b345ecd1227e | train | tests/modin/test_schemas_on_modin.py | train | unionai-oss/pandera:tests/modin/test_schemas_on_modin.py | 356 | 8 | assert | test_schema_model | """Unit tests for modin data structures."""
import typing
from unittest.mock import MagicMock
import modin.pandas as mpd
import pandas as pd
import pytest
import pandera as pa
from pandera import extensions
from pandera.engines import numpy_engine, pandas_engine
from pandera.typing.modin import DataFrame, Index, Ser... | expected_failures | modified | 121ca53126c75b4c7dbfa01df33795a99b60d88dd92f5f07a35d0a8c80bd1b33 | assert|test_schema_model|"""Unit tests for modin data structures.""" import typing from unittest.mock import MagicMock import modin.pandas as mpd import pandas as pd import pytest import pandera as pa from pandera import extensions from pandera.engines import numpy_engine, pandas_engine from pandera.typing.modin import... | expected_failures | 356 | 8 |
unionai-oss/pandera | train | 202 | 8ccede9af865e578138e23cbf183b345ecd1227e | train | tests/modin/test_schemas_on_modin.py | train | unionai-oss/pandera:tests/modin/test_schemas_on_modin.py | 460 | 13 | pytest.raises | test_check_decorators | """Unit tests for modin data structures."""
import typing
from unittest.mock import MagicMock
import modin.pandas as mpd
import pandas as pd
import pytest
import pandera as pa
from pandera import extensions
from pandera.engines import numpy_engine, pandas_engine
from pandera.typing.modin import DataFrame, Index, Ser... | pa.errors.SchemaError) | modified | a4c69ffb4220ae2dcb140f57a8398ea8b68de5cc7e2573ed563b973c2a8ba201 | pytest.raises|test_check_decorators|"""Unit tests for modin data structures.""" import typing from unittest.mock import MagicMock import modin.pandas as mpd import pandas as pd import pytest import pandera as pa from pandera import extensions from pandera.engines import numpy_engine, pandas_engine from pandera.typing.m... | pa.errors.SchemaError) | 460 | 13 |
unionai-oss/pandera | train | 202 | 8ccede9af865e578138e23cbf183b345ecd1227e | train | tests/mypy/test_static_type_checking.py | val | unionai-oss/pandera:tests/mypy/test_static_type_checking.py | 77 | 8 | assert | test_mypy_pandas_dataframe | # pylint: skip-file
"""Unit tests for static type checking of dataframes.
This module uses subprocess and the pytest.capdf fixture to capture the output
of calling mypy on the python modules in the tests/core/static folder.
"""
import importlib
import os
import re
import subprocess
import sys
import typing
from pathl... | expected["errcode"] | added | c2a54251a28b3070a49dcb3dc084b94d3771375082d55ebdb1a0c182a66e4d57 | assert|test_mypy_pandas_dataframe|# pylint: skip-file """Unit tests for static type checking of dataframes. This module uses subprocess and the pytest.capdf fixture to capture the output of calling mypy on the python modules in the tests/core/static folder. """ import importlib import os import re import subprocess imp... | null | null | null |
unionai-oss/pandera | train | 202 | 8ccede9af865e578138e23cbf183b345ecd1227e | train | tests/mypy/test_static_type_checking.py | val | unionai-oss/pandera:tests/mypy/test_static_type_checking.py | 183 | 8 | assert | test_pandas_stubs_false_positives | # pylint: skip-file
"""Unit tests for static type checking of dataframes.
This module uses subprocess and the pytest.capdf fixture to capture the output
of calling mypy on the python modules in the tests/core/static folder.
"""
import importlib
import os
import re
import subprocess
import sys
import typing
from pathl... | expected["msg"] == error["msg"] or re.match( expected["msg"], error["msg"] ) | added | 3f735ea24d78d2563f05870fad3413f4f31700d9cd202a97c5053af1673cc10f | assert|test_pandas_stubs_false_positives|# pylint: skip-file """Unit tests for static type checking of dataframes. This module uses subprocess and the pytest.capdf fixture to capture the output of calling mypy on the python modules in the tests/core/static folder. """ import importlib import os import re import subproc... | null | null | null |
unionai-oss/pandera | train | 203 | 0301dec5c18eef93b243d9a2cc564a37c150e521 | train | tests/core/test_schemas.py | test | unionai-oss/pandera:tests/core/test_schemas.py | 534 | 13 | pytest.raises | test_dataframe_schema_check_function_types | """Testing creation and manipulation of DataFrameSchema objects."""
# pylint: disable=too-many-lines,redefined-outer-name
import copy
from datetime import datetime, timedelta
from functools import partial
from typing import Any, Callable, Dict, List, Tuple, Type, Union
import numpy as np
import pandas as pd
import py... | errors.SchemaError) | added | 8c7c3da48b4ace68c7a841c5b7a76959d30a90f6e7fb878954001a88bdbe3eb3 | pytest.raises|test_dataframe_schema_check_function_types|"""Testing creation and manipulation of DataFrameSchema objects.""" # pylint: disable=too-many-lines,redefined-outer-name import copy from datetime import datetime, timedelta from functools import partial from typing import Any, Callable, Dict, List, Tuple, Type,... | null | null | null |
unionai-oss/pandera | train | 203 | 0301dec5c18eef93b243d9a2cc564a37c150e521 | train | tests/core/test_schemas.py | test | unionai-oss/pandera:tests/core/test_schemas.py | 1,730 | 8 | assert | test_reset_index_level | """Testing creation and manipulation of DataFrameSchema objects."""
# pylint: disable=too-many-lines,redefined-outer-name
import copy
from datetime import datetime, timedelta
from functools import partial
from typing import Any, Callable, Dict, List, Tuple, Type, Union
import numpy as np
import pandas as pd
import py... | isinstance(test_schema.index, (Index, MultiIndex)) | modified | 11f07816c703b6aedb5e2f3716beb0b990c7148011cedd4b50448d15c8d3c859 | assert|test_reset_index_level|"""Testing creation and manipulation of DataFrameSchema objects.""" # pylint: disable=too-many-lines,redefined-outer-name import copy from datetime import datetime, timedelta from functools import partial from typing import Any, Callable, Dict, List, Tuple, Type, Union import numpy as np i... | index | 1,727 | 8 |
unionai-oss/pandera | train | 203 | 0301dec5c18eef93b243d9a2cc564a37c150e521 | train | tests/core/test_schemas.py | test | unionai-oss/pandera:tests/core/test_schemas.py | 1,774 | 4 | assert | test_update_columns | """Testing creation and manipulation of DataFrameSchema objects."""
# pylint: disable=too-many-lines,redefined-outer-name
import copy
from datetime import datetime, timedelta
from functools import partial
from typing import Any, Callable, Dict, List, Tuple, Type, Union
import numpy as np
import pandas as pd
import py... | test_schema.columns["col2"].unique | added | 40975b5416c6a55a4aa4279681a1c8b90e258771bd282df24a01e583860891fc | assert|test_update_columns|"""Testing creation and manipulation of DataFrameSchema objects.""" # pylint: disable=too-many-lines,redefined-outer-name import copy from datetime import datetime, timedelta from functools import partial from typing import Any, Callable, Dict, List, Tuple, Type, Union import numpy as np impo... | null | null | null |
unionai-oss/pandera | train | 203 | 0301dec5c18eef93b243d9a2cc564a37c150e521 | train | tests/core/test_schemas.py | test | unionai-oss/pandera:tests/core/test_schemas.py | 1,791 | 8 | assert | test_series_schema_dtype | """Testing creation and manipulation of DataFrameSchema objects."""
# pylint: disable=too-many-lines,redefined-outer-name
import copy
from datetime import datetime, timedelta
from functools import partial
from typing import Any, Callable, Dict, List, Tuple, Type, Union
import numpy as np
import pandas as pd
import py... | None | modified | 36a29dce1aad7417b34914b317ceb85872e44cc732db4b59d9d3868340db08b5 | assert|test_series_schema_dtype|"""Testing creation and manipulation of DataFrameSchema objects.""" # pylint: disable=too-many-lines,redefined-outer-name import copy from datetime import datetime, timedelta from functools import partial from typing import Any, Callable, Dict, List, Tuple, Type, Union import numpy as np... | Engine.dtype(dtype) | 1,789 | 8 |
unionai-oss/pandera | train | 204 | 061f9893a64a581064f47a46d8cdc38c5c489ebd | train | tests/core/test_extensions.py | train | unionai-oss/pandera:tests/core/test_extensions.py | 277 | 13 | pytest.raises | test_schema_model_field_kwarg | # pylint: disable=no-member,redefined-outer-name,unused-argument
# pylint: disable=unused-variable
"""Unit tests for pandera API extensions."""
from typing import Any, Optional, Union
import pandas as pd
import pytest
import pandera as pa
import pandera.strategies as st
from pandera import DataType, extensions
from ... | pa.errors.SchemaError) | modified | b8b1bfbfe35512bd47c3f88b230e6c29f4bbde9e5ada81a9bda7580d4d4329d0 | pytest.raises|test_schema_model_field_kwarg|# pylint: disable=no-member,redefined-outer-name,unused-argument # pylint: disable=unused-variable """Unit tests for pandera API extensions.""" from typing import Any, Optional, Union import pandas as pd import pytest import pandera as pa import pandera.strategies as st from ... | pa.errors.SchemaError) | 277 | 13 |
unionai-oss/pandera | train | 204 | 061f9893a64a581064f47a46d8cdc38c5c489ebd | train | tests/core/test_pandas_accessor.py | train | unionai-oss/pandera:tests/core/test_pandas_accessor.py | 49 | 8 | assert | test_dataframe_series_add_schema | """Unit tests for pandas_accessor module."""
from typing import Union
from unittest.mock import patch
import pandas as pd
import pytest
import pandera as pa
import pandera.core.pandas.container
@pytest.mark.parametrize(
"schema1, schema2, data, invalid_data",
[
[
pa.DataFrameSchema({"col... | schema2 | modified | 99ce2def132c59e873a69c7d049de53898ddbed08bffbf5cedeef7afff49e5fc | assert|test_dataframe_series_add_schema|"""Unit tests for pandas_accessor module.""" from typing import Union from unittest.mock import patch import pandas as pd import pytest import pandera as pa import pandera.core.pandas.container @pytest.mark.parametrize( "schema1, schema2, data, invalid_data", [ [ pa.DataFrameSche... | schema2 | 48 | 8 |
unionai-oss/pandera | train | 204 | 061f9893a64a581064f47a46d8cdc38c5c489ebd | train | tests/core/test_schema_inference.py | val | unionai-oss/pandera:tests/core/test_schema_inference.py | 137 | 4 | assert | test_infer_series_schema | # pylint: disable=W0212
"""Unit tests for schema inference module."""
from typing import Type, Union
import pandas as pd
import pytest
import pandera as pa
from pandera.schema_inference.pandas import (
infer_dataframe_schema,
infer_schema,
infer_series_schema,
)
def _create_dataframe(
multi_index: b... | isinstance(schema_with_new_checks.validate(series), pd.Series) | modified | 4a1e53320417a28a66c308c0547454f9767d0094f526bd029486e1d2ec280b9f | assert|test_infer_series_schema|# pylint: disable=W0212 """Unit tests for schema inference module.""" from typing import Type, Union import pandas as pd import pytest import pandera as pa from pandera.schema_inference.pandas import ( infer_dataframe_schema, infer_schema, infer_series_schema, ) def _create_dataframe( mu... | isinstance(schema_with_new_checks.validate(series), pd.Series) | 135 | 4 |
unionai-oss/pandera | train | 204 | 061f9893a64a581064f47a46d8cdc38c5c489ebd | train | tests/dask/test_dask.py | train | unionai-oss/pandera:tests/dask/test_dask.py | 78 | 4 | assert_* | test_series_schema | """ Tests that basic Pandera functionality works for Dask objects. """
from typing import cast
import dask.dataframe as dd
import pandas as pd
import pytest
import pandera as pa
from pandera.typing.dask import DataFrame, Index, Series
class IntSchema(pa.DataFrameModel): # pylint: disable=missing-class-docstring
... | dseries.compute()) | modified | 6b0097e4f2b25c859a78228d3ef89f86a9f02405c4931006d3f478fc84fdf73d | assert_*|test_series_schema|""" Tests that basic Pandera functionality works for Dask objects. """ from typing import cast import dask.dataframe as dd import pandas as pd import pytest import pandera as pa from pandera.typing.dask import DataFrame, Index, Series class IntSchema(pa.DataFrameModel): # pylint: disable=mis... | dseries.compute()) | 78 | 4 |
unionai-oss/pandera | train | 204 | 061f9893a64a581064f47a46d8cdc38c5c489ebd | train | tests/fastapi/test_app.py | train | unionai-oss/pandera:tests/fastapi/test_app.py | 80 | 4 | assert_* | test_upload_file_endpoint | # pylint: disable=redefined-outer-name,unused-argument
"""Unit tests for using pandera types in fastapi endpoints."""
import io
import subprocess
import time
from copy import deepcopy
import pandas as pd
import pytest
import requests
from hypothesis import given
from tests.fastapi.models import Transactions, Transac... | TransactionsOut.validate(expected_result[cost_notna])) | modified | 3557a4f68bff5506c8c83fe5141a3d82698b7d6054ae0f57d1c59d77c67db200 | assert_*|test_upload_file_endpoint|# pylint: disable=redefined-outer-name,unused-argument """Unit tests for using pandera types in fastapi endpoints.""" import io import subprocess import time from copy import deepcopy import pandas as pd import pytest import requests from hypothesis import given from tests.fastapi.mod... | TransactionsOut.validate(expected_result[cost_notna])) | 78 | 4 |
unionai-oss/pandera | train | 204 | 061f9893a64a581064f47a46d8cdc38c5c489ebd | train | tests/geopandas/test_geopandas.py | train | unionai-oss/pandera:tests/geopandas/test_geopandas.py | 58 | 4 | assert | test_schema_model | """Unit tests for the geopandas integration."""
import geopandas as gpd
import pytest
from shapely.geometry import Polygon
import pandera as pa
from pandera.typing import Series
from pandera.typing.geopandas import GeoDataFrame, GeoSeries
def test_dataframe_schema():
"""Test that DataFrameSchema works on GeoDat... | isinstance( GeoDataFrame[Schema]({"geometry": data}), gpd.GeoDataFrame ) | modified | 29e3fee984c12ad5dccb56ebf28598b07fbf0228169277cd0a3c255c25ea8f77 | assert|test_schema_model|"""Unit tests for the geopandas integration.""" import geopandas as gpd import pytest from shapely.geometry import Polygon import pandera as pa from pandera.typing import Series from pandera.typing.geopandas import GeoDataFrame, GeoSeries def test_dataframe_schema(): """Test that DataFrameSchem... | isinstance( GeoDataFrame[Schema]({"geometry": data}), gpd.GeoDataFrame ) | 58 | 4 |
unionai-oss/pandera | train | 204 | 061f9893a64a581064f47a46d8cdc38c5c489ebd | train | tests/mypy/test_static_type_checking.py | val | unionai-oss/pandera:tests/mypy/test_static_type_checking.py | 191 | 4 | assert | test_pandas_stubs_false_positives | # pylint: skip-file
"""Unit tests for static type checking of dataframes.
This module uses subprocess and the pytest.capdf fixture to capture the output
of calling mypy on the python modules in the tests/core/static folder.
"""
import importlib
import os
import re
import subprocess
import sys
import typing
from pathl... | len(resulting_errors) | added | a14fece0a414f0e34ecf7697275e110b5b7b1a17b581614a98c25a46867aa8ed | assert|test_pandas_stubs_false_positives|# pylint: skip-file """Unit tests for static type checking of dataframes. This module uses subprocess and the pytest.capdf fixture to capture the output of calling mypy on the python modules in the tests/core/static folder. """ import importlib import os import re import subproc... | null | null | null |
unionai-oss/pandera | train | 204 | 061f9893a64a581064f47a46d8cdc38c5c489ebd | train | tests/strategies/test_strategies.py | train | unionai-oss/pandera:tests/strategies/test_strategies.py | 131 | 4 | assert | test_check_strategy_continuous | # pylint: disable=undefined-variable,redefined-outer-name,invalid-name,undefined-loop-variable,too-many-lines # noqa
"""Unit tests for pandera data generating strategies."""
import datetime
import operator
import re
from typing import Any, Callable, Optional, Set
from unittest.mock import MagicMock
import numpy as np... | value | modified | cb937472b928acfcfd44f67f82bbdcc4d4749f583aaa5f03cd78b34521a05e9a | assert|test_check_strategy_continuous|# pylint: disable=undefined-variable,redefined-outer-name,invalid-name,undefined-loop-variable,too-many-lines # noqa """Unit tests for pandera data generating strategies.""" import datetime import operator import re from typing import Any, Callable, Optional, Set from unittest.mock... | value | 130 | 4 |
unionai-oss/pandera | train | 205 | 1a702422a3a853a1c44a20e9c9476f92fcea6b6e | train | tests/core/test_dtypes.py | train | unionai-oss/pandera:tests/core/test_dtypes.py | 312 | 4 | assert | test_check_not_equivalent | """Tests a variety of python and pandas dtypes, and tests some specific
coercion examples."""
# pylint doesn't know about __init__ generated with dataclass
# pylint:disable=unexpected-keyword-arg,no-value-for-parameter
import dataclasses
import datetime
import inspect
from decimal import Decimal
from typing import Any,... | False | modified | 055110c1f718285ccdef00bfe661fd0142f43bb399ddb7567352ce97b7dfe6f1 | assert|test_check_not_equivalent|"""Tests a variety of python and pandas dtypes, and tests some specific coercion examples.""" # pylint doesn't know about __init__ generated with dataclass # pylint:disable=unexpected-keyword-arg,no-value-for-parameter import dataclasses import datetime import inspect from decimal impor... | False | 312 | 4 |
unionai-oss/pandera | train | 205 | 1a702422a3a853a1c44a20e9c9476f92fcea6b6e | train | tests/core/test_dtypes.py | train | unionai-oss/pandera:tests/core/test_dtypes.py | 462 | 4 | assert | test_coerce_dt | """Tests a variety of python and pandas dtypes, and tests some specific
coercion examples."""
# pylint doesn't know about __init__ generated with dataclass
# pylint:disable=unexpected-keyword-arg,no-value-for-parameter
import dataclasses
import datetime
import inspect
from decimal import Decimal
from typing import Any,... | expected | added | 1cbc6886ed59eb4eed9071c044fa76e0ef03ee50f8e83270245b4f8a9e315211 | assert|test_coerce_dt|"""Tests a variety of python and pandas dtypes, and tests some specific coercion examples.""" # pylint doesn't know about __init__ generated with dataclass # pylint:disable=unexpected-keyword-arg,no-value-for-parameter import dataclasses import datetime import inspect from decimal import Decimal f... | null | null | null |
unionai-oss/pandera | train | 205 | 1a702422a3a853a1c44a20e9c9476f92fcea6b6e | train | tests/core/test_dtypes.py | train | unionai-oss/pandera:tests/core/test_dtypes.py | 627 | 4 | assert | test_is_string | """Tests a variety of python and pandas dtypes, and tests some specific
coercion examples."""
# pylint doesn't know about __init__ generated with dataclass
# pylint:disable=unexpected-keyword-arg,no-value-for-parameter
import dataclasses
import datetime
import inspect
from decimal import Decimal
from typing import Any,... | expected | added | dd4e90b5d3891b699e8f4afce7bbbeba4070eb38ab639e80f3036c2b0de75653 | assert|test_is_string|"""Tests a variety of python and pandas dtypes, and tests some specific coercion examples.""" # pylint doesn't know about __init__ generated with dataclass # pylint:disable=unexpected-keyword-arg,no-value-for-parameter import dataclasses import datetime import inspect from decimal import Decimal f... | null | null | null |
unionai-oss/pandera | train | 205 | 1a702422a3a853a1c44a20e9c9476f92fcea6b6e | train | tests/core/test_dtypes.py | train | unionai-oss/pandera:tests/core/test_dtypes.py | 637 | 4 | assert | test_is_category | """Tests a variety of python and pandas dtypes, and tests some specific
coercion examples."""
# pylint doesn't know about __init__ generated with dataclass
# pylint:disable=unexpected-keyword-arg,no-value-for-parameter
import dataclasses
import datetime
import inspect
from decimal import Decimal
from typing import Any,... | expected | added | 930caaf46b218b372bfbfcef1190d9d7aeb27ab147ab71c996768778410f1083 | assert|test_is_category|"""Tests a variety of python and pandas dtypes, and tests some specific coercion examples.""" # pylint doesn't know about __init__ generated with dataclass # pylint:disable=unexpected-keyword-arg,no-value-for-parameter import dataclasses import datetime import inspect from decimal import Decimal... | null | null | null |
unionai-oss/pandera | train | 206 | 5fecc47f1e8a18ad230019baa9831b0aecfed259 | train | tests/core/test_dtypes.py | train | unionai-oss/pandera:tests/core/test_dtypes.py | 570 | 8 | assert | test_inferred_dtype | """Tests a variety of python and pandas dtypes, and tests some specific
coercion examples."""
# pylint doesn't know about __init__ generated with dataclass
# pylint:disable=unexpected-keyword-arg,no-value-for-parameter
import dataclasses
import datetime
import inspect
from decimal import Decimal
from typing import Any,... | str(inferred_datatype).lower().startswith(alias) | added | 368f4520dbbb7237fda995572fc2dd65e1f88abf60e3054b6c5a5edf800b92f7 | assert|test_inferred_dtype|"""Tests a variety of python and pandas dtypes, and tests some specific coercion examples.""" # pylint doesn't know about __init__ generated with dataclass # pylint:disable=unexpected-keyword-arg,no-value-for-parameter import dataclasses import datetime import inspect from decimal import Deci... | null | null | null |
unionai-oss/pandera | train | 206 | 5fecc47f1e8a18ad230019baa9831b0aecfed259 | train | tests/core/test_dtypes.py | train | unionai-oss/pandera:tests/core/test_dtypes.py | 595 | 4 | assert | test_is_uint | """Tests a variety of python and pandas dtypes, and tests some specific
coercion examples."""
# pylint doesn't know about __init__ generated with dataclass
# pylint:disable=unexpected-keyword-arg,no-value-for-parameter
import dataclasses
import datetime
import inspect
from decimal import Decimal
from typing import Any,... | expected | added | 65d092db9b265df40588d5d80c5b7fb13c7f43e825418bb8be198dfeb9a8d077 | assert|test_is_uint|"""Tests a variety of python and pandas dtypes, and tests some specific coercion examples.""" # pylint doesn't know about __init__ generated with dataclass # pylint:disable=unexpected-keyword-arg,no-value-for-parameter import dataclasses import datetime import inspect from decimal import Decimal fro... | null | null | null |
unionai-oss/pandera | train | 206 | 5fecc47f1e8a18ad230019baa9831b0aecfed259 | train | tests/core/test_dtypes.py | train | unionai-oss/pandera:tests/core/test_dtypes.py | 633 | 4 | assert | test_is_bool | """Tests a variety of python and pandas dtypes, and tests some specific
coercion examples."""
# pylint doesn't know about __init__ generated with dataclass
# pylint:disable=unexpected-keyword-arg,no-value-for-parameter
import dataclasses
import datetime
import inspect
from decimal import Decimal
from typing import Any,... | expected | added | d6203d853bb8caacdc8c6c6edd32818dc0bcfa59d9a5b7dd649ecd8f739019f2 | assert|test_is_bool|"""Tests a variety of python and pandas dtypes, and tests some specific coercion examples.""" # pylint doesn't know about __init__ generated with dataclass # pylint:disable=unexpected-keyword-arg,no-value-for-parameter import dataclasses import datetime import inspect from decimal import Decimal fro... | null | null | null |
unionai-oss/pandera | train | 206 | 5fecc47f1e8a18ad230019baa9831b0aecfed259 | train | tests/core/test_dtypes.py | train | unionai-oss/pandera:tests/core/test_dtypes.py | 654 | 4 | assert | test_is_category | """Tests a variety of python and pandas dtypes, and tests some specific
coercion examples."""
# pylint doesn't know about __init__ generated with dataclass
# pylint:disable=unexpected-keyword-arg,no-value-for-parameter
import dataclasses
import datetime
import inspect
from decimal import Decimal
from typing import Any,... | expected | added | 8d4e3c2d800bfe2ade664c97b7ed1ff000144a07d834e2e8549a3ec9bda465f6 | assert|test_is_category|"""Tests a variety of python and pandas dtypes, and tests some specific coercion examples.""" # pylint doesn't know about __init__ generated with dataclass # pylint:disable=unexpected-keyword-arg,no-value-for-parameter import dataclasses import datetime import inspect from decimal import Decimal... | null | null | null |
unionai-oss/pandera | train | 206 | 5fecc47f1e8a18ad230019baa9831b0aecfed259 | train | tests/strategies/test_strategies.py | train | unionai-oss/pandera:tests/strategies/test_strategies.py | 606 | 8 | assert | test_multiindex_strategy | # pylint: disable=undefined-variable,redefined-outer-name,invalid-name,undefined-loop-variable,too-many-lines # noqa
"""Unit tests for pandera data generating strategies."""
import datetime
import operator
import re
from typing import Any, Callable, Optional, Set
from unittest.mock import MagicMock
import numpy as np... | data_type.check(actual_data_type) | modified | 896429997bf4b5d30a592fe5919aa0a0c061a8ad65e0a4c3d8c81d89ce57b200 | assert|test_multiindex_strategy|# pylint: disable=undefined-variable,redefined-outer-name,invalid-name,undefined-loop-variable,too-many-lines # noqa """Unit tests for pandera data generating strategies.""" import datetime import operator import re from typing import Any, Callable, Optional, Set from unittest.mock impor... | data_type.check(actual_data_type) | 607 | 8 |
unionai-oss/pandera | train | 206 | 5fecc47f1e8a18ad230019baa9831b0aecfed259 | train | tests/strategies/test_strategies.py | train | unionai-oss/pandera:tests/strategies/test_strategies.py | 642 | 9 | pytest.raises | test_field_element_strategy | # pylint: disable=undefined-variable,redefined-outer-name,invalid-name,undefined-loop-variable,too-many-lines # noqa
"""Unit tests for pandera data generating strategies."""
import datetime
import operator
import re
from typing import Any, Callable, Optional, Set
from unittest.mock import MagicMock
import numpy as np... | pa.errors.BaseStrategyOnlyError) | modified | 9df3d5e7f8611b6a3825b5d8e1b0e91b93c25ceb25ef1c78d88fcaf5740192c4 | pytest.raises|test_field_element_strategy|# pylint: disable=undefined-variable,redefined-outer-name,invalid-name,undefined-loop-variable,too-many-lines # noqa """Unit tests for pandera data generating strategies.""" import datetime import operator import re from typing import Any, Callable, Optional, Set from unittest.... | pa.errors.BaseStrategyOnlyError) | 643 | 9 |
unionai-oss/pandera | train | 206 | 5fecc47f1e8a18ad230019baa9831b0aecfed259 | train | tests/strategies/test_strategies.py | train | unionai-oss/pandera:tests/strategies/test_strategies.py | 666 | 8 | assert | test_check_nullable_field_strategy | # pylint: disable=undefined-variable,redefined-outer-name,invalid-name,undefined-loop-variable,too-many-lines # noqa
"""Unit tests for pandera data generating strategies."""
import datetime
import operator
import re
from typing import Any, Callable, Optional, Set
from unittest.mock import MagicMock
import numpy as np... | example.notna().all() | modified | 4ee12e68a19b3653ac3c18d3cc9f67a9b3e8571698fe59c4da02dec7266a74ec | assert|test_check_nullable_field_strategy|# pylint: disable=undefined-variable,redefined-outer-name,invalid-name,undefined-loop-variable,too-many-lines # noqa """Unit tests for pandera data generating strategies.""" import datetime import operator import re from typing import Any, Callable, Optional, Set from unittest.... | example.notna().all() | 667 | 8 |
unionai-oss/pandera | train | 206 | 5fecc47f1e8a18ad230019baa9831b0aecfed259 | train | tests/strategies/test_strategies.py | train | unionai-oss/pandera:tests/strategies/test_strategies.py | 684 | 8 | assert | test_check_nullable_dataframe_strategy | # pylint: disable=undefined-variable,redefined-outer-name,invalid-name,undefined-loop-variable,too-many-lines # noqa
"""Unit tests for pandera data generating strategies."""
import datetime
import operator
import re
from typing import Any, Callable, Optional, Set
from unittest.mock import MagicMock
import numpy as np... | example.notna().all(axis=None) | modified | 2ba666aab5e5f958d4bf9f9e86662b1ab2f6e8a0441570af628d42ebf0a1e9db | assert|test_check_nullable_dataframe_strategy|# pylint: disable=undefined-variable,redefined-outer-name,invalid-name,undefined-loop-variable,too-many-lines # noqa """Unit tests for pandera data generating strategies.""" import datetime import operator import re from typing import Any, Callable, Optional, Set from unitt... | example.notna().all(axis=None) | 685 | 8 |
unionai-oss/pandera | train | 207 | 2edc6d6557b932764bfd0e823260ab422136e06b | train | tests/core/test_schemas.py | test | unionai-oss/pandera:tests/core/test_schemas.py | 357 | 4 | assert | test_duplicate_columns_dataframe | """Testing creation and manipulation of DataFrameSchema objects."""
# pylint: disable=too-many-lines,redefined-outer-name
import copy
from datetime import datetime, timedelta
from functools import partial
from typing import Any, Callable, Dict, List, Tuple, Type, Union
import numpy as np
import pandas as pd
import py... | not schema.unique_column_names | added | fc60f94f921aae587bffab2f8d13048cbfa874e4794c2706f5c3c637cdaa7ee9 | assert|test_duplicate_columns_dataframe|"""Testing creation and manipulation of DataFrameSchema objects.""" # pylint: disable=too-many-lines,redefined-outer-name import copy from datetime import datetime, timedelta from functools import partial from typing import Any, Callable, Dict, List, Tuple, Type, Union import num... | null | null | null |
unionai-oss/pandera | train | 207 | 2edc6d6557b932764bfd0e823260ab422136e06b | train | tests/core/test_schemas.py | test | unionai-oss/pandera:tests/core/test_schemas.py | 1,708 | 12 | assert | test_set_index_append | """Testing creation and manipulation of DataFrameSchema objects."""
# pylint: disable=too-many-lines,redefined-outer-name
import copy
from datetime import datetime, timedelta
from functools import partial
from typing import Any, Callable, Dict, List, Tuple, Type, Union
import numpy as np
import pandas as pd
import py... | schema_simple.columns[key].dtype | added | 836fb650bfab63fb7ca5e645bed2381d479e80e809737a32ad2ac4db4c30e7cd | assert|test_set_index_append|"""Testing creation and manipulation of DataFrameSchema objects.""" # pylint: disable=too-many-lines,redefined-outer-name import copy from datetime import datetime, timedelta from functools import partial from typing import Any, Callable, Dict, List, Tuple, Type, Union import numpy as np im... | null | null | null |
unionai-oss/pandera | train | 207 | 2edc6d6557b932764bfd0e823260ab422136e06b | train | tests/core/test_schemas.py | test | unionai-oss/pandera:tests/core/test_schemas.py | 1,899 | 8 | assert | test_schema_str_repr | """Testing creation and manipulation of DataFrameSchema objects."""
# pylint: disable=too-many-lines,redefined-outer-name
import copy
from datetime import datetime, timedelta
from functools import partial
from typing import Any, Callable, Dict, List, Tuple, Type, Union
import numpy as np
import pandas as pd
import py... | x.startswith(f"<Schema {schema.__class__.__name__}(") | added | aa9c94f0c26046a9d833c63256cce2fe5ffa0b0a782287e90045664540513bb6 | assert|test_schema_str_repr|"""Testing creation and manipulation of DataFrameSchema objects.""" # pylint: disable=too-many-lines,redefined-outer-name import copy from datetime import datetime, timedelta from functools import partial from typing import Any, Callable, Dict, List, Tuple, Type, Union import numpy as np imp... | null | null | null |
unionai-oss/pandera | train | 207 | 2edc6d6557b932764bfd0e823260ab422136e06b | train | tests/core/test_schemas.py | test | unionai-oss/pandera:tests/core/test_schemas.py | 1,947 | 8 | assert | test_schema_level_unique_missing_columns | """Testing creation and manipulation of DataFrameSchema objects."""
# pylint: disable=too-many-lines,redefined-outer-name
import copy
from datetime import datetime, timedelta
from functools import partial
from typing import Any, Callable, Dict, List, Tuple, Type, Union
import numpy as np
import pandas as pd
import py... | "duplicates" | added | e4b7215ef44e8216f4f97acb511b096000aaa407e0074c69aca302bc35ab2f13 | assert|test_schema_level_unique_missing_columns|"""Testing creation and manipulation of DataFrameSchema objects.""" # pylint: disable=too-many-lines,redefined-outer-name import copy from datetime import datetime, timedelta from functools import partial from typing import Any, Callable, Dict, List, Tuple, Type, Union im... | null | null | null |
unionai-oss/pandera | train | 208 | d6c2078996ba5684c466eb47f919f07ddd9100f4 | train | tests/core/test_checks_builtin.py | train | unionai-oss/pandera:tests/core/test_checks_builtin.py | 949 | 13 | pytest.raises | test_argument_check | """Tests for builtin checks in pandera.core.checks.Check
"""
import pickle
from typing import Iterable
import pandas as pd
import pytest
from pandera.core.checks import Check
from pandera.core.pandas.array import SeriesSchema
from pandera.core.pandas.components import Column
from pandera.core.pandas.container import... | ValueError) | modified | e5f54340989916bdacc7f31213c0859773674af3b6c35588593e0d32532ead37 | pytest.raises|test_argument_check|"""Tests for builtin checks in pandera.core.checks.Check """ import pickle from typing import Iterable import pandas as pd import pytest from pandera.core.checks import Check from pandera.core.pandas.array import SeriesSchema from pandera.core.pandas.components import Column from pande... | ValueError) | 948 | 13 |
unionai-oss/pandera | train | 208 | d6c2078996ba5684c466eb47f919f07ddd9100f4 | train | tests/core/test_checks_builtin.py | train | unionai-oss/pandera:tests/core/test_checks_builtin.py | 1,036 | 9 | pytest.raises | test_unique_values_eq_raise_error | """Tests for builtin checks in pandera.core.checks.Check
"""
import pickle
from typing import Iterable
import pandas as pd
import pytest
from pandera.core.checks import Check
from pandera.core.pandas.array import SeriesSchema
from pandera.core.pandas.components import Column
from pandera.core.pandas.container import... | (TypeError, ValueError)) | modified | a084f4e9f02746c8fc18f1f25bebc95a84adbcbe8c54553b56bc426c5d199f64 | pytest.raises|test_unique_values_eq_raise_error|"""Tests for builtin checks in pandera.core.checks.Check """ import pickle from typing import Iterable import pandas as pd import pytest from pandera.core.checks import Check from pandera.core.pandas.array import SeriesSchema from pandera.core.pandas.components import Col... | (TypeError, ValueError)) | 1,035 | 9 |
unionai-oss/pandera | train | 208 | d6c2078996ba5684c466eb47f919f07ddd9100f4 | train | tests/core/test_engine.py | train | unionai-oss/pandera:tests/core/test_engine.py | 151 | 4 | assert | test_register_dtype_overwrite | """Tests Engine subclassing and registring DataTypes."""
# pylint:disable=redefined-outer-name,unused-argument
# pylint:disable=missing-function-docstring,missing-class-docstring
import re
from typing import Any, Generator, List, Union
import pytest
from pandera.dtypes import DataType
from pandera.engines.engine impo... | _DtypeB() | modified | 0b9b8084d39778473d3c34f9cb1b4600295e424ede7172defe96d6f9742d8d55 | assert|test_register_dtype_overwrite|"""Tests Engine subclassing and registring DataTypes.""" # pylint:disable=redefined-outer-name,unused-argument # pylint:disable=missing-function-docstring,missing-class-docstring import re from typing import Any, Generator, List, Union import pytest from pandera.dtypes import DataTy... | _DtypeB() | 151 | 4 |
unionai-oss/pandera | train | 208 | d6c2078996ba5684c466eb47f919f07ddd9100f4 | train | tests/core/test_engine.py | train | unionai-oss/pandera:tests/core/test_engine.py | 162 | 9 | pytest.raises | test_register_base_pandera_dtypes | """Tests Engine subclassing and registring DataTypes."""
# pylint:disable=redefined-outer-name,unused-argument
# pylint:disable=missing-function-docstring,missing-class-docstring
import re
from typing import Any, Generator, List, Union
import pytest
from pandera.dtypes import DataType
from pandera.engines.engine impo... | ValueError, match=re.escape( "Subclasses of ['tests.core.test_engine.BaseDataType', " + "'tests.core.test_engine.BaseDataType'] " + "cannot be registered with FakeEngine." )) | modified | 104490e56691f17cc4bce6eb8aa92fe607d531ee584a128d91ce12d31bcc4851 | pytest.raises|test_register_base_pandera_dtypes|"""Tests Engine subclassing and registring DataTypes.""" # pylint:disable=redefined-outer-name,unused-argument # pylint:disable=missing-function-docstring,missing-class-docstring import re from typing import Any, Generator, List, Union import pytest from pandera.dtypes im... | ValueError, match=re.escape( "Subclasses of ['tests.core.test_engine.BaseDataType', " + "'tests.core.test_engine.BaseDataType'] " + "cannot be registered with FakeEngine." )) | 162 | 9 |
unionai-oss/pandera | train | 208 | d6c2078996ba5684c466eb47f919f07ddd9100f4 | train | tests/core/test_extension_modules.py | train | unionai-oss/pandera:tests/core/test_extension_modules.py | 16 | 17 | pytest.raises | test_hypotheses_module_import | """Tests for extension module imports."""
import pytest
from pandera.core.hypotheses import Hypothesis
from pandera.backends.pandas.hypotheses import HAS_SCIPY
def test_hypotheses_module_import() -> None:
"""Test that Hypothesis built-in methods raise import error."""
if not HAS_SCIPY:
for fn in [
... | ImportError) | modified | a87aec7e2c03e6759ec9475b8ddf1dec76e2cafc1ea6ce26c8c4664fadd9b420 | pytest.raises|test_hypotheses_module_import|"""Tests for extension module imports.""" import pytest from pandera.core.hypotheses import Hypothesis from pandera.backends.pandas.hypotheses import HAS_SCIPY def test_hypotheses_module_import() -> None: """Test that Hypothesis built-in methods raise import error.""" if not ... | ImportError) | 16 | 17 |
unionai-oss/pandera | train | 208 | d6c2078996ba5684c466eb47f919f07ddd9100f4 | train | tests/core/test_model.py | train | unionai-oss/pandera:tests/core/test_model.py | 457 | 9 | pytest.raises | test_check_regex | """Tests schema creation and validation from type annotations."""
# pylint:disable=missing-class-docstring,missing-function-docstring,too-few-public-methods
import re
from copy import deepcopy
from typing import Any, Generic, Iterable, Optional, TypeVar
import pandas as pd
import pytest
import pandera as pa
import pa... | pa.errors.SchemaErrors, match="1 schema errors were found") | modified | 28aa1e4b43508d968ada9970d58ea7f2606901448de00a658d9b64e0e97c81d5 | pytest.raises|test_check_regex|"""Tests schema creation and validation from type annotations.""" # pylint:disable=missing-class-docstring,missing-function-docstring,too-few-public-methods import re from copy import deepcopy from typing import Any, Generic, Iterable, Optional, TypeVar import pandas as pd import pytest i... | pa.errors.SchemaErrors, match="1 schema errors were found") | 457 | 9 |
unionai-oss/pandera | train | 208 | d6c2078996ba5684c466eb47f919f07ddd9100f4 | train | tests/core/test_model.py | train | unionai-oss/pandera:tests/core/test_model.py | 977 | 4 | assert | test_field_name_access_inherit | """Tests schema creation and validation from type annotations."""
# pylint:disable=missing-class-docstring,missing-function-docstring,too-few-public-methods
import re
from copy import deepcopy
from typing import Any, Generic, Iterable, Optional, TypeVar
import pandas as pd
import pytest
import pandera as pa
import pa... | "_i3" | modified | 794d03d381abc2a6e8b628ae79ac165e108fe93c0a711122d9d075c5deba5627 | assert|test_field_name_access_inherit|"""Tests schema creation and validation from type annotations.""" # pylint:disable=missing-class-docstring,missing-function-docstring,too-few-public-methods import re from copy import deepcopy from typing import Any, Generic, Iterable, Optional, TypeVar import pandas as pd import p... | "_i3" | 977 | 4 |
unionai-oss/pandera | train | 208 | d6c2078996ba5684c466eb47f919f07ddd9100f4 | train | tests/strategies/test_strategies.py | train | unionai-oss/pandera:tests/strategies/test_strategies.py | 284 | 4 | assert | test_isin_notin_strategies | # pylint: disable=undefined-variable,redefined-outer-name,invalid-name,undefined-loop-variable,too-many-lines # noqa
"""Unit tests for pandera data generating strategies."""
import datetime
import operator
import re
from typing import Any, Callable, Optional, Set
from unittest.mock import MagicMock
import numpy as np... | values | modified | e75a295a03dd4777826630b30e2eb9f641b7265337e7a076c6b735fc371fbfcc | assert|test_isin_notin_strategies|# pylint: disable=undefined-variable,redefined-outer-name,invalid-name,undefined-loop-variable,too-many-lines # noqa """Unit tests for pandera data generating strategies.""" import datetime import operator import re from typing import Any, Callable, Optional, Set from unittest.mock imp... | values | 284 | 4 |
unionai-oss/pandera | train | 209 | 7774ab64fd1027e09103d86bcbd46d99b7fd364e | train | tests/core/test_checks_builtin.py | train | unionai-oss/pandera:tests/core/test_checks_builtin.py | 1,036 | 9 | pytest.raises | test_unique_values_eq_raise_error | """Tests for builtin checks in pandera.api.checks.Check
"""
import pickle
from typing import Iterable
import pandas as pd
import pytest
from pandera.api.checks import Check
from pandera.api.pandas.array import SeriesSchema
from pandera.api.pandas.components import Column
from pandera.api.pandas.container import Data... | (TypeError, ValueError)) | modified | 3486e810f05f7dd2d3cf771a3bacdbf8b30768a9fcc82444e4860dc9aaab1035 | pytest.raises|test_unique_values_eq_raise_error|"""Tests for builtin checks in pandera.api.checks.Check """ import pickle from typing import Iterable import pandas as pd import pytest from pandera.api.checks import Check from pandera.api.pandas.array import SeriesSchema from pandera.api.pandas.components import Column ... | (TypeError, ValueError)) | 1,036 | 9 |
unionai-oss/pandera | train | 209 | 7774ab64fd1027e09103d86bcbd46d99b7fd364e | train | tests/core/test_extension_modules.py | train | unionai-oss/pandera:tests/core/test_extension_modules.py | 16 | 17 | pytest.raises | test_hypotheses_module_import | """Tests for extension module imports."""
import pytest
from pandera.api.hypotheses import Hypothesis
from pandera.backends.pandas.hypotheses import HAS_SCIPY
def test_hypotheses_module_import() -> None:
"""Test that Hypothesis built-in methods raise import error."""
if not HAS_SCIPY:
for fn in [
... | ImportError) | modified | 2b3f20d7f93ea3b02594404dca631b9662b351bcbe4782247203dc79107fadb6 | pytest.raises|test_hypotheses_module_import|"""Tests for extension module imports.""" import pytest from pandera.api.hypotheses import Hypothesis from pandera.backends.pandas.hypotheses import HAS_SCIPY def test_hypotheses_module_import() -> None: """Test that Hypothesis built-in methods raise import error.""" if not H... | ImportError) | 16 | 17 |
unionai-oss/pandera | train | 209 | 7774ab64fd1027e09103d86bcbd46d99b7fd364e | train | tests/core/test_extensions.py | train | unionai-oss/pandera:tests/core/test_extensions.py | 18 | 4 | assert | test_custom_checks_in_dir | # pylint: disable=no-member,redefined-outer-name,unused-argument
# pylint: disable=unused-variable
"""Unit tests for pandera API extensions."""
from typing import Any, Optional, Union
import pandas as pd
import pytest
import pandera as pa
import pandera.strategies as st
from pandera import DataType, extensions
from ... | dir(Check) | modified | 4e909f8062202983a4c4542e58011f972e3db9d1ea11cce8bd9d0ce03a1c6bf6 | assert|test_custom_checks_in_dir|# pylint: disable=no-member,redefined-outer-name,unused-argument # pylint: disable=unused-variable """Unit tests for pandera API extensions.""" from typing import Any, Optional, Union import pandas as pd import pytest import pandera as pa import pandera.strategies as st from pandera imp... | dir(Check) | 18 | 4 |
unionai-oss/pandera | train | 209 | 7774ab64fd1027e09103d86bcbd46d99b7fd364e | train | tests/core/test_pandas_accessor.py | train | unionai-oss/pandera:tests/core/test_pandas_accessor.py | 51 | 8 | assert | test_dataframe_series_add_schema | """Unit tests for pandas_accessor module."""
from typing import Union
from unittest.mock import patch
import pandas as pd
import pytest
import pandera as pa
import pandera.api.pandas.container
@pytest.mark.parametrize(
"schema1, schema2, data, invalid_data",
[
[
pa.DataFrameSchema({"col"... | schema1 | modified | 8899e1a0b468050380afca192677d5413752fe95442db384bb3daf04b0d7545f | assert|test_dataframe_series_add_schema|"""Unit tests for pandas_accessor module.""" from typing import Union from unittest.mock import patch import pandas as pd import pytest import pandera as pa import pandera.api.pandas.container @pytest.mark.parametrize( "schema1, schema2, data, invalid_data", [ [ pa.DataFrameSchem... | schema1 | 51 | 8 |
unionai-oss/pandera | train | 209 | 7774ab64fd1027e09103d86bcbd46d99b7fd364e | train | tests/core/test_schemas.py | test | unionai-oss/pandera:tests/core/test_schemas.py | 663 | 4 | assert | test_required | """Testing creation and manipulation of DataFrameSchema objects."""
# pylint: disable=too-many-lines,redefined-outer-name
import copy
from datetime import datetime, timedelta
from functools import partial
from typing import Any, Callable, Dict, List, Tuple, Type, Union
import numpy as np
import pandas as pd
import py... | isinstance(df, pd.DataFrame) | modified | 677c306ad1cedd41551909e48c97800dae094a3f00b7eb6d0084a7746af01684 | assert|test_required|"""Testing creation and manipulation of DataFrameSchema objects.""" # pylint: disable=too-many-lines,redefined-outer-name import copy from datetime import datetime, timedelta from functools import partial from typing import Any, Callable, Dict, List, Tuple, Type, Union import numpy as np import pan... | isinstance(df, pd.DataFrame) | 663 | 4 |
unionai-oss/pandera | train | 209 | 7774ab64fd1027e09103d86bcbd46d99b7fd364e | train | tests/dask/test_dask_not_installed.py | train | unionai-oss/pandera:tests/dask/test_dask_not_installed.py | 47 | 8 | assert | test_dask_not_installed | """Tests behavior when dask is not installed. """
import sys
from unittest import mock
import pandas as pd
import pytest
def test_dask_not_installed() -> None:
"""
Test that Pandera and its modules can be imported and continue to work
without dask.
"""
with mock.patch.dict("sys.modules", {"dask":... | pandera.typing.AnnotationInfo(annotation).is_generic_df | modified | 1f3ec297919008fe9f6604393cf0a4d07078e5d73c0f45cf0ae8711ba89c25d9 | assert|test_dask_not_installed|"""Tests behavior when dask is not installed. """ import sys from unittest import mock import pandas as pd import pytest def test_dask_not_installed() -> None: """ Test that Pandera and its modules can be imported and continue to work without dask. """ with mock.patch.dict("sys.modules", ... | pandera.typing.AnnotationInfo(annotation).is_generic_df | 47 | 8 |
unionai-oss/pandera | train | 209 | 7774ab64fd1027e09103d86bcbd46d99b7fd364e | train | tests/io/test_io.py | train | unionai-oss/pandera:tests/io/test_io.py | 603 | 4 | assert | test_inferred_schema_io | """Unit tests for io module"""
import platform
import tempfile
from io import StringIO
from pathlib import Path
from unittest import mock
import pandas as pd
import pytest
from packaging import version
import pandera
import pandera.api.extensions as pa_ext
import pandera.typing as pat
from pandera.api.pandas.contain... | schema_from_yaml | modified | afe2ea308928625853b1a5d9461f0e6974e721a4367a1b51740b299244ee1822 | assert|test_inferred_schema_io|"""Unit tests for io module""" import platform import tempfile from io import StringIO from pathlib import Path from unittest import mock import pandas as pd import pytest from packaging import version import pandera import pandera.api.extensions as pa_ext import pandera.typing as pat fro... | schema_from_yaml | 603 | 4 |
unionai-oss/pandera | train | 209 | 7774ab64fd1027e09103d86bcbd46d99b7fd364e | train | tests/strategies/test_strategies.py | train | unionai-oss/pandera:tests/strategies/test_strategies.py | 974 | 4 | assert | test_empty_nullable_schema | # pylint: disable=undefined-variable,redefined-outer-name,invalid-name,undefined-loop-variable,too-many-lines # noqa
"""Unit tests for pandera data generating strategies."""
import datetime
import operator
import re
from typing import Any, Callable, Optional, Set
from unittest.mock import MagicMock
import numpy as np... | data.draw(schema.strategy(size=0)).empty | modified | a092f723c3db656acc0f1f3bbd8fb3254031cc4b665e169a432e8d8a20329f06 | assert|test_empty_nullable_schema|# pylint: disable=undefined-variable,redefined-outer-name,invalid-name,undefined-loop-variable,too-many-lines # noqa """Unit tests for pandera data generating strategies.""" import datetime import operator import re from typing import Any, Callable, Optional, Set from unittest.mock imp... | data.draw(schema.strategy(size=0)).empty | 974 | 4 |
unionai-oss/pandera | train | 210 | eb6b035cd3ad39bb0d6d342975458890dda55762 | train | tests/core/test_schemas.py | test | unionai-oss/pandera:tests/core/test_schemas.py | 1,984 | 8 | assert | test_missing_columns | """Testing creation and manipulation of DataFrameSchema objects."""
# pylint: disable=too-many-lines,redefined-outer-name
import copy
from datetime import datetime, timedelta
from functools import partial
from typing import Any, Callable, Dict, List, Tuple, Type, Union
import numpy as np
import pandas as pd
import py... | (exc.failure_cases["check"] == "column_in_dataframe").all() | added | 0887e7011fc9fd7f58f1180cac935727160843a1a0e4da231968a00fcca8fa03 | assert|test_missing_columns|"""Testing creation and manipulation of DataFrameSchema objects.""" # pylint: disable=too-many-lines,redefined-outer-name import copy from datetime import datetime, timedelta from functools import partial from typing import Any, Callable, Dict, List, Tuple, Type, Union import numpy as np imp... | null | null | null |
unionai-oss/pandera | train | 210 | eb6b035cd3ad39bb0d6d342975458890dda55762 | train | tests/core/test_schemas.py | test | unionai-oss/pandera:tests/core/test_schemas.py | 1,985 | 8 | assert | test_missing_columns | """Testing creation and manipulation of DataFrameSchema objects."""
# pylint: disable=too-many-lines,redefined-outer-name
import copy
from datetime import datetime, timedelta
from functools import partial
from typing import Any, Callable, Dict, List, Tuple, Type, Union
import numpy as np
import pandas as pd
import py... | [ "column3", "column2", ] | added | ca94dd30ab1e421f9a23f398697ed288cd1cfcdad1a58e762bd145d3a077c789 | assert|test_missing_columns|"""Testing creation and manipulation of DataFrameSchema objects.""" # pylint: disable=too-many-lines,redefined-outer-name import copy from datetime import datetime, timedelta from functools import partial from typing import Any, Callable, Dict, List, Tuple, Type, Union import numpy as np imp... | null | null | null |
unionai-oss/pandera | train | 211 | 339ea93d67ddad4a0b7dd2df403659ea2ddfe451 | train | tests/core/test_schemas.py | test | unionai-oss/pandera:tests/core/test_schemas.py | 928 | 8 | assert | """Testing creation and manipulation of DataFrameSchema objects."""
# pylint: disable=too-many-lines,redefined-outer-name
import copy
from datetime import datetime, timedelta
from functools import partial
from typing import Any, Callable, Dict, List, Tuple, Type, Union
import numpy as np
import pandas as pd
import py... | getattr(new_schema.columns["col"], bool_kwarg) | modified | 61038519868644bd04a92cf0325f17b8525fcdb3509efb0fd338f211115f416e | assert||"""Testing creation and manipulation of DataFrameSchema objects.""" # pylint: disable=too-many-lines,redefined-outer-name import copy from datetime import datetime, timedelta from functools import partial from typing import Any, Callable, Dict, List, Tuple, Type, Union import numpy as np import pandas as pd imp... | getattr(new_schema.columns["col"], bool_kwarg) | 928 | 8 | |
unionai-oss/pandera | train | 211 | 339ea93d67ddad4a0b7dd2df403659ea2ddfe451 | train | tests/core/test_schemas.py | test | unionai-oss/pandera:tests/core/test_schemas.py | 1,122 | 16 | assert | test_lazy_dataframe_validation_error | """Testing creation and manipulation of DataFrameSchema objects."""
# pylint: disable=too-many-lines,redefined-outer-name
import copy
from datetime import datetime, timedelta
from functools import partial
from typing import Any, Callable, Dict, List, Tuple, Type, Union
import numpy as np
import pandas as pd
import py... | err_df.check.values | modified | 955711921b9a0d710f0364822d96c69a0e5a1ac8457c4d3aa28f257ce0a61e68 | assert|test_lazy_dataframe_validation_error|"""Testing creation and manipulation of DataFrameSchema objects.""" # pylint: disable=too-many-lines,redefined-outer-name import copy from datetime import datetime, timedelta from functools import partial from typing import Any, Callable, Dict, List, Tuple, Type, Union import... | err_df.check.values | 1,122 | 16 |
unionai-oss/pandera | train | 211 | 339ea93d67ddad4a0b7dd2df403659ea2ddfe451 | train | tests/core/test_schemas.py | test | unionai-oss/pandera:tests/core/test_schemas.py | 1,583 | 8 | assert | test_schema_coerce_inplace_validation | """Testing creation and manipulation of DataFrameSchema objects."""
# pylint: disable=too-many-lines,redefined-outer-name
import copy
from datetime import datetime, timedelta
from functools import partial
from typing import Any, Callable, Dict, List, Tuple, Type, Union
import numpy as np
import pandas as pd
import py... | from_dtype | modified | 5066a44d8b3db478699606e74f3e6d01c3359b100916d6439190681d7854bec7 | assert|test_schema_coerce_inplace_validation|"""Testing creation and manipulation of DataFrameSchema objects.""" # pylint: disable=too-many-lines,redefined-outer-name import copy from datetime import datetime, timedelta from functools import partial from typing import Any, Callable, Dict, List, Tuple, Type, Union impor... | from_dtype | 1,583 | 8 |
unionai-oss/pandera | train | 211 | 339ea93d67ddad4a0b7dd2df403659ea2ddfe451 | train | tests/core/test_schemas.py | test | unionai-oss/pandera:tests/core/test_schemas.py | 1,792 | 9 | pytest.raises | test_update_columns | """Testing creation and manipulation of DataFrameSchema objects."""
# pylint: disable=too-many-lines,redefined-outer-name
import copy
from datetime import datetime, timedelta
from functools import partial
from typing import Any, Callable, Dict, List, Tuple, Type, Union
import numpy as np
import pandas as pd
import py... | errors.SchemaInitError) | modified | 00fb72f3496270ee5ece2b5db206c7941480d7c07b1168aa90666c748a4b33d1 | pytest.raises|test_update_columns|"""Testing creation and manipulation of DataFrameSchema objects.""" # pylint: disable=too-many-lines,redefined-outer-name import copy from datetime import datetime, timedelta from functools import partial from typing import Any, Callable, Dict, List, Tuple, Type, Union import numpy as ... | errors.SchemaInitError) | 1,792 | 9 |
unionai-oss/pandera | train | 212 | aa3f3d842a31e427663c6a9515b9550b70eb7bb5 | train | tests/core/test_checks.py | train | unionai-oss/pandera:tests/core/test_checks.py | 502 | 9 | pytest.raises | test_check_backend_not_found | """Tests the way Columns are Checked"""
import copy
import pandas as pd
import pytest
from pandera import (
Bool,
Check,
Column,
DataFrameSchema,
Float,
Index,
Int,
SeriesSchema,
String,
errors,
)
from pandera.backends.pandas import error_formatters
def test_vectorized_check... | KeyError, match="Backend not found for class") | added | 9fb922b43bc2ad63056fea398e4490bf45571512425f3da16725f801f2c40bfc | pytest.raises|test_check_backend_not_found|"""Tests the way Columns are Checked""" import copy import pandas as pd import pytest from pandera import ( Bool, Check, Column, DataFrameSchema, Float, Index, Int, SeriesSchema, String, errors, ) from pandera.backends.pandas import error_formatters def test_vectorized_checks(... | null | null | null |
unionai-oss/pandera | train | 213 | 286657558bd480a402e7b17d2abc5eb6878e6f4c | train | tests/core/test_model.py | train | unionai-oss/pandera:tests/core/test_model.py | 49 | 9 | pytest.raises | test_to_schema_and_validate | """Tests schema creation and validation from type annotations."""
# pylint:disable=missing-class-docstring,missing-function-docstring,too-few-public-methods
import re
from copy import deepcopy
from typing import Any, Generic, Iterable, Optional, TypeVar
import pandas as pd
import pytest
import pandera as pa
import pa... | pa.errors.SchemaError) | added | 475f409d22395a39718b9878a168af6625f85f32f6af45bce8db3d338ee70c2a | pytest.raises|test_to_schema_and_validate|"""Tests schema creation and validation from type annotations.""" # pylint:disable=missing-class-docstring,missing-function-docstring,too-few-public-methods import re from copy import deepcopy from typing import Any, Generic, Iterable, Optional, TypeVar import pandas as pd impo... | null | null | null |
unionai-oss/pandera | train | 213 | 286657558bd480a402e7b17d2abc5eb6878e6f4c | train | tests/core/test_model.py | train | unionai-oss/pandera:tests/core/test_model.py | 130 | 4 | assert | test_optional_column | """Tests schema creation and validation from type annotations."""
# pylint:disable=missing-class-docstring,missing-function-docstring,too-few-public-methods
import re
from copy import deepcopy
from typing import Any, Generic, Iterable, Optional, TypeVar
import pandas as pd
import pytest
import pandera as pa
import pa... | not schema.columns["a"].required | added | d5094101def0739be36b0f38db63abb3a1b346a8b6c406203aac1f609e2d45da | assert|test_optional_column|"""Tests schema creation and validation from type annotations.""" # pylint:disable=missing-class-docstring,missing-function-docstring,too-few-public-methods import re from copy import deepcopy from typing import Any, Generic, Iterable, Optional, TypeVar import pandas as pd import pytest impo... | null | null | null |
unionai-oss/pandera | train | 213 | 286657558bd480a402e7b17d2abc5eb6878e6f4c | train | tests/core/test_model.py | train | unionai-oss/pandera:tests/core/test_model.py | 879 | 4 | assert | test_inherit_alias | """Tests schema creation and validation from type annotations."""
# pylint:disable=missing-class-docstring,missing-function-docstring,too-few-public-methods
import re
from copy import deepcopy
from typing import Any, Generic, Iterable, Optional, TypeVar
import pandas as pd
import pytest
import pandera as pa
import pa... | pa.Column(str, name="b") | modified | ab3748c5ace112386a30ec7d68d502e0d094682e7f27bb730931e50191f63004 | assert|test_inherit_alias|"""Tests schema creation and validation from type annotations.""" # pylint:disable=missing-class-docstring,missing-function-docstring,too-few-public-methods import re from copy import deepcopy from typing import Any, Generic, Iterable, Optional, TypeVar import pandas as pd import pytest import... | pa.Column(str, name="c") | 876 | 4 |
unionai-oss/pandera | train | 213 | 286657558bd480a402e7b17d2abc5eb6878e6f4c | train | tests/core/test_model.py | train | unionai-oss/pandera:tests/core/test_model.py | 1,001 | 4 | assert | test_column_access_regex | """Tests schema creation and validation from type annotations."""
# pylint:disable=missing-class-docstring,missing-function-docstring,too-few-public-methods
import re
from copy import deepcopy
from typing import Any, Generic, Iterable, Optional, TypeVar
import pandas as pd
import pytest
import pandera as pa
import pa... | "column_([0-9])+" | added | 02e55d07514151a2a0f7c09b33c40e8f64b4a7d249d9697b59a971f59078d49f | assert|test_column_access_regex|"""Tests schema creation and validation from type annotations.""" # pylint:disable=missing-class-docstring,missing-function-docstring,too-few-public-methods import re from copy import deepcopy from typing import Any, Generic, Iterable, Optional, TypeVar import pandas as pd import pytest ... | null | null | null |
unionai-oss/pandera | train | 214 | fe83c19a1aebb127f22e8bee849be70a1a96c33a | train | tests/core/test_schema_components.py | train | unionai-oss/pandera:tests/core/test_schema_components.py | 856 | 4 | assert | test_index_validation_pandas_string_dtype | """Testing the components of the Schema objects."""
import copy
from typing import Any, List, Optional, Tuple, Type
import pandas as pd
import pytest
from pandera import (
Check,
Column,
DataFrameSchema,
DateTime,
Float,
Index,
Int,
MultiIndex,
SeriesSchema,
String,
errors... | isinstance(schema.validate(df), pd.DataFrame) | added | ccb289150d6274fc9e0e7c9f273e289da6e24bfa23c4264d2529588f4abdcdf3 | assert|test_index_validation_pandas_string_dtype|"""Testing the components of the Schema objects.""" import copy from typing import Any, List, Optional, Tuple, Type import pandas as pd import pytest from pandera import ( Check, Column, DataFrameSchema, DateTime, Float, Index, Int, MultiIndex, SeriesSchema, String, erro... | null | null | null |
unionai-oss/pandera | train | 215 | c82f690ad8bad59a576b4ebe61bd40f6c0baee67 | train | tests/core/test_checks.py | train | unionai-oss/pandera:tests/core/test_checks.py | 489 | 8 | assert | test_custom_check_error_is_failure_case | """Tests the way Columns are Checked"""
import copy
import pandas as pd
import pytest
from pandera import (
Bool,
Check,
Column,
DataFrameSchema,
Float,
Index,
Int,
SeriesSchema,
String,
errors,
)
from pandera.backends.pandas import error_formatters
def test_vectorized_check... | {errors.SchemaErrorReason.CHECK_ERROR: 1} | modified | 75cdcf0f9192734ea70ee4bdfa7c241d360b4eee22d97db41782dbd11b1b2849 | assert|test_custom_check_error_is_failure_case|"""Tests the way Columns are Checked""" import copy import pandas as pd import pytest from pandera import ( Bool, Check, Column, DataFrameSchema, Float, Index, Int, SeriesSchema, String, errors, ) from pandera.backends.pandas import error_formatters def test_vectorized_che... | {"check_error": 1} | 489 | 8 |
unionai-oss/pandera | train | 215 | c82f690ad8bad59a576b4ebe61bd40f6c0baee67 | train | tests/core/test_checks.py | train | unionai-oss/pandera:tests/core/test_checks.py | 502 | 9 | pytest.raises | test_check_backend_not_found | """Tests the way Columns are Checked"""
import copy
import pandas as pd
import pytest
from pandera import (
Bool,
Check,
Column,
DataFrameSchema,
Float,
Index,
Int,
SeriesSchema,
String,
errors,
)
from pandera.backends.pandas import error_formatters
def test_vectorized_check... | KeyError, match="Backend not found for class") | modified | 35b244ad4f7607bc854ea4291d6bd36a34db25886e609c910dbe273d3c798c8e | pytest.raises|test_check_backend_not_found|"""Tests the way Columns are Checked""" import copy import pandas as pd import pytest from pandera import ( Bool, Check, Column, DataFrameSchema, Float, Index, Int, SeriesSchema, String, errors, ) from pandera.backends.pandas import error_formatters def test_vectorized_checks(... | KeyError, match="Backend not found for class") | 502 | 9 |
unionai-oss/pandera | train | 215 | c82f690ad8bad59a576b4ebe61bd40f6c0baee67 | train | tests/core/test_schemas.py | test | unionai-oss/pandera:tests/core/test_schemas.py | 1,950 | 8 | assert | test_schema_level_unique_missing_columns | """Testing creation and manipulation of DataFrameSchema objects."""
# pylint: disable=too-many-lines,redefined-outer-name
import copy
from datetime import datetime, timedelta
from functools import partial
from typing import Any, Callable, Dict, List, Tuple, Type, Union
import numpy as np
import pandas as pd
import py... | errors.SchemaErrorReason.DUPLICATES | modified | a1137383a7a2aceafeefcfe4d236d27709d50bf1dde86e52a7b6bba9e3b4d734 | assert|test_schema_level_unique_missing_columns|"""Testing creation and manipulation of DataFrameSchema objects.""" # pylint: disable=too-many-lines,redefined-outer-name import copy from datetime import datetime, timedelta from functools import partial from typing import Any, Callable, Dict, List, Tuple, Type, Union im... | "duplicates" | 1,947 | 8 |
unionai-oss/pandera | train | 215 | c82f690ad8bad59a576b4ebe61bd40f6c0baee67 | train | tests/core/test_schemas.py | test | unionai-oss/pandera:tests/core/test_schemas.py | 1,973 | 4 | assert | test_column_set_unique | """Testing creation and manipulation of DataFrameSchema objects."""
# pylint: disable=too-many-lines,redefined-outer-name
import copy
from datetime import datetime, timedelta
from functools import partial
from typing import Any, Callable, Dict, List, Tuple, Type, Union
import numpy as np
import pandas as pd
import py... | test_schema.columns["a"].unique | added | 0ba9618347e30d19572eda1a357b0eb2cdcdcd8c833fc3ab4d83c3b50d2cdf91 | assert|test_column_set_unique|"""Testing creation and manipulation of DataFrameSchema objects.""" # pylint: disable=too-many-lines,redefined-outer-name import copy from datetime import datetime, timedelta from functools import partial from typing import Any, Callable, Dict, List, Tuple, Type, Union import numpy as np i... | null | null | null |
unionai-oss/pandera | train | 215 | c82f690ad8bad59a576b4ebe61bd40f6c0baee67 | train | tests/core/test_schemas.py | test | unionai-oss/pandera:tests/core/test_schemas.py | 1,990 | 8 | assert | test_missing_columns | """Testing creation and manipulation of DataFrameSchema objects."""
# pylint: disable=too-many-lines,redefined-outer-name
import copy
from datetime import datetime, timedelta
from functools import partial
from typing import Any, Callable, Dict, List, Tuple, Type, Union
import numpy as np
import pandas as pd
import py... | (exc.failure_cases["check"] == "column_in_dataframe").all() | added | 4af05dff36301ed6a25e7c63e6162ab6ad687ad07d171cc0c3dd1385d24e23d3 | assert|test_missing_columns|"""Testing creation and manipulation of DataFrameSchema objects.""" # pylint: disable=too-many-lines,redefined-outer-name import copy from datetime import datetime, timedelta from functools import partial from typing import Any, Callable, Dict, List, Tuple, Type, Union import numpy as np imp... | null | null | null |
unionai-oss/pandera | train | 215 | c82f690ad8bad59a576b4ebe61bd40f6c0baee67 | train | tests/core/test_schemas.py | test | unionai-oss/pandera:tests/core/test_schemas.py | 1,991 | 8 | assert | test_missing_columns | """Testing creation and manipulation of DataFrameSchema objects."""
# pylint: disable=too-many-lines,redefined-outer-name
import copy
from datetime import datetime, timedelta
from functools import partial
from typing import Any, Callable, Dict, List, Tuple, Type, Union
import numpy as np
import pandas as pd
import py... | [ "column3", "column2", ] | added | 85552f098bb321fb8b5e5369d377b2a8d3f11870bce0e3b854cd228f7f64ccf5 | assert|test_missing_columns|"""Testing creation and manipulation of DataFrameSchema objects.""" # pylint: disable=too-many-lines,redefined-outer-name import copy from datetime import datetime, timedelta from functools import partial from typing import Any, Callable, Dict, List, Tuple, Type, Union import numpy as np imp... | null | null | null |
unionai-oss/pandera | train | 216 | e8239d4925d313f863f77c7a674a92517351fc5c | train | tests/core/test_from_to_format_conversions.py | train | unionai-oss/pandera:tests/core/test_from_to_format_conversions.py | 224 | 21 | pytest.raises | test_from_format | # pylint: disable=missing-class-docstring,too-few-public-methods
"""Test conversion of data from and to different formats."""
import io
import tempfile
from typing import Any
import pandas as pd
import pytest
import pandera as pa
from pandera.engines import pandas_engine
class InSchema(pa.DataFrameModel):
str_... | pa.errors.SchemaError) | added | a31dde625e9df41fa029a9b1dc1e09c220140509837477b51e77ce0a92ef48db | pytest.raises|test_from_format|# pylint: disable=missing-class-docstring,too-few-public-methods """Test conversion of data from and to different formats.""" import io import tempfile from typing import Any import pandas as pd import pytest import pandera as pa from pandera.engines import pandas_engine class InSchema(pa... | null | null | null |
unionai-oss/pandera | train | 216 | e8239d4925d313f863f77c7a674a92517351fc5c | train | tests/core/test_from_to_format_conversions.py | train | unionai-oss/pandera:tests/core/test_from_to_format_conversions.py | 229 | 12 | assert | test_from_format | # pylint: disable=missing-class-docstring,too-few-public-methods
"""Test conversion of data from and to different formats."""
import io
import tempfile
from typing import Any
import pandas as pd
import pytest
import pandera as pa
from pandera.engines import pandas_engine
class InSchema(pa.DataFrameModel):
str_... | df.equals(out) | added | e5615f18f1dab140dfd4edd264c50e632745a3f5072ced11d50976581d687204 | assert|test_from_format|# pylint: disable=missing-class-docstring,too-few-public-methods """Test conversion of data from and to different formats.""" import io import tempfile from typing import Any import pandas as pd import pytest import pandera as pa from pandera.engines import pandas_engine class InSchema(pa.DataFr... | null | null | null |
unionai-oss/pandera | train | 216 | e8239d4925d313f863f77c7a674a92517351fc5c | train | tests/core/test_from_to_format_conversions.py | train | unionai-oss/pandera:tests/core/test_from_to_format_conversions.py | 276 | 13 | pytest.raises | test_to_format | # pylint: disable=missing-class-docstring,too-few-public-methods
"""Test conversion of data from and to different formats."""
import io
import tempfile
from typing import Any
import pandas as pd
import pytest
import pandera as pa
from pandera.engines import pandas_engine
class InSchema(pa.DataFrameModel):
str_... | ImportError) | added | 18c9912d0dd834e87c72b187f16b15dd6bdfc99c24eb220be97c137a19b0173b | pytest.raises|test_to_format|# pylint: disable=missing-class-docstring,too-few-public-methods """Test conversion of data from and to different formats.""" import io import tempfile from typing import Any import pandas as pd import pytest import pandera as pa from pandera.engines import pandas_engine class InSchema(pa.D... | null | null | null |
unionai-oss/pandera | train | 216 | e8239d4925d313f863f77c7a674a92517351fc5c | train | tests/core/test_from_to_format_conversions.py | train | unionai-oss/pandera:tests/core/test_from_to_format_conversions.py | 293 | 9 | pytest.raises | test_to_format | # pylint: disable=missing-class-docstring,too-few-public-methods
"""Test conversion of data from and to different formats."""
import io
import tempfile
from typing import Any
import pandas as pd
import pytest
import pandera as pa
from pandera.engines import pandas_engine
class InSchema(pa.DataFrameModel):
str_... | pa.errors.SchemaError) | added | e914e7dc042d032afdf669791900504ba8241369891a6ff8b99366c4ff37dae5 | pytest.raises|test_to_format|# pylint: disable=missing-class-docstring,too-few-public-methods """Test conversion of data from and to different formats.""" import io import tempfile from typing import Any import pandas as pd import pytest import pandera as pa from pandera.engines import pandas_engine class InSchema(pa.D... | null | null | null |
unionai-oss/pandera | train | 217 | 19d0d686dbe014cbd3789e9d777d2320dbeef011 | train | tests/core/test_schema_components.py | train | unionai-oss/pandera:tests/core/test_schema_components.py | 389 | 4 | assert | test_column_regex_multiindex | """Testing the components of the Schema objects."""
import copy
from typing import Any, List, Optional, Tuple, Type
import pandas as pd
import pytest
from pandera import (
Check,
Column,
DataFrameSchema,
DateTime,
Float,
Index,
Int,
MultiIndex,
SeriesSchema,
String,
errors... | isinstance(dataframe_schema.validate(data), pd.DataFrame) | added | 9d121ad8ba6481c0c359210977f988ecf84b9836704118235d5501ab25fbbb2d | assert|test_column_regex_multiindex|"""Testing the components of the Schema objects.""" import copy from typing import Any, List, Optional, Tuple, Type import pandas as pd import pytest from pandera import ( Check, Column, DataFrameSchema, DateTime, Float, Index, Int, MultiIndex, SeriesSchema, String, errors, ) from pa... | null | null | null |
unionai-oss/pandera | train | 217 | 19d0d686dbe014cbd3789e9d777d2320dbeef011 | train | tests/core/test_schema_components.py | train | unionai-oss/pandera:tests/core/test_schema_components.py | 464 | 8 | assert | test_column_regex_matching | """Testing the components of the Schema objects."""
import copy
from typing import Any, List, Optional, Tuple, Type
import pandas as pd
import pytest
from pandera import (
Check,
Column,
DataFrameSchema,
DateTime,
Float,
Index,
Int,
MultiIndex,
SeriesSchema,
String,
errors... | matched_columns.tolist() | added | dca42c3c62e851f21005968c41685f35cfd883b5a48a424d8cc92adeff22f210 | assert|test_column_regex_matching|"""Testing the components of the Schema objects.""" import copy from typing import Any, List, Optional, Tuple, Type import pandas as pd import pytest from pandera import ( Check, Column, DataFrameSchema, DateTime, Float, Index, Int, MultiIndex, SeriesSchema, String, errors, ) from pand... | null | null | null |
unionai-oss/pandera | train | 217 | 19d0d686dbe014cbd3789e9d777d2320dbeef011 | train | tests/core/test_schema_components.py | train | unionai-oss/pandera:tests/core/test_schema_components.py | 492 | 4 | assert | test_column_regex_matching_non_str_types | """Testing the components of the Schema objects."""
import copy
from typing import Any, List, Optional, Tuple, Type
import pandas as pd
import pytest
from pandera import (
Check,
Column,
DataFrameSchema,
DateTime,
Float,
Index,
Int,
MultiIndex,
SeriesSchema,
String,
errors... | [*matched_columns] | added | 358fd7c491684905b9fc4d6034e7a0757b807860fe4ff4a587c0a4d5ed2eb2f0 | assert|test_column_regex_matching_non_str_types|"""Testing the components of the Schema objects.""" import copy from typing import Any, List, Optional, Tuple, Type import pandas as pd import pytest from pandera import ( Check, Column, DataFrameSchema, DateTime, Float, Index, Int, MultiIndex, SeriesSchema, String, error... | null | null | null |
unionai-oss/pandera | train | 217 | 19d0d686dbe014cbd3789e9d777d2320dbeef011 | train | tests/core/test_schema_components.py | train | unionai-oss/pandera:tests/core/test_schema_components.py | 616 | 13 | pytest.raises | test_column_type_can_be_set | """Testing the components of the Schema objects."""
import copy
from typing import Any, List, Optional, Tuple, Type
import pandas as pd
import pytest
from pandera import (
Check,
Column,
DataFrameSchema,
DateTime,
Float,
Index,
Int,
MultiIndex,
SeriesSchema,
String,
errors... | TypeError) | added | 436428186e6b240686e292694325266640a61ecfbaac0f88f11cf301cb36739e | pytest.raises|test_column_type_can_be_set|"""Testing the components of the Schema objects.""" import copy from typing import Any, List, Optional, Tuple, Type import pandas as pd import pytest from pandera import ( Check, Column, DataFrameSchema, DateTime, Float, Index, Int, MultiIndex, SeriesSchema, String, errors, ) f... | null | null | null |
unionai-oss/pandera | train | 218 | a0d95c7927d5f222dc3664e411a121499b6ebbdd | train | tests/core/test_dtypes.py | train | unionai-oss/pandera:tests/core/test_dtypes.py | 467 | 4 | assert | test_coerce_dt | """Tests a variety of python and pandas dtypes, and tests some specific
coercion examples."""
# pylint doesn't know about __init__ generated with dataclass
# pylint:disable=unexpected-keyword-arg,no-value-for-parameter
import dataclasses
import datetime
import inspect
from decimal import Decimal
from typing import Any,... | expected | added | 530d09421bbb9990683800471610e7290241577e9d6812e737998ece12375aa6 | assert|test_coerce_dt|"""Tests a variety of python and pandas dtypes, and tests some specific coercion examples.""" # pylint doesn't know about __init__ generated with dataclass # pylint:disable=unexpected-keyword-arg,no-value-for-parameter import dataclasses import datetime import inspect from decimal import Decimal f... | null | null | null |
unionai-oss/pandera | train | 218 | a0d95c7927d5f222dc3664e411a121499b6ebbdd | train | tests/core/test_dtypes.py | train | unionai-oss/pandera:tests/core/test_dtypes.py | 575 | 8 | assert | test_inferred_dtype | """Tests a variety of python and pandas dtypes, and tests some specific
coercion examples."""
# pylint doesn't know about __init__ generated with dataclass
# pylint:disable=unexpected-keyword-arg,no-value-for-parameter
import dataclasses
import datetime
import inspect
from decimal import Decimal
from typing import Any,... | str(inferred_datatype).lower().startswith(alias) | modified | 16cc5c2449c2ad214cf130ce9078772ee4961700d272af510ac51237ced77fed | assert|test_inferred_dtype|"""Tests a variety of python and pandas dtypes, and tests some specific coercion examples.""" # pylint doesn't know about __init__ generated with dataclass # pylint:disable=unexpected-keyword-arg,no-value-for-parameter import dataclasses import datetime import inspect from decimal import Deci... | actual_dtype.check(inferred_datatype) | 573 | 8 |
unionai-oss/pandera | train | 218 | a0d95c7927d5f222dc3664e411a121499b6ebbdd | train | tests/core/test_dtypes.py | train | unionai-oss/pandera:tests/core/test_dtypes.py | 659 | 4 | assert | test_is_category | """Tests a variety of python and pandas dtypes, and tests some specific
coercion examples."""
# pylint doesn't know about __init__ generated with dataclass
# pylint:disable=unexpected-keyword-arg,no-value-for-parameter
import dataclasses
import datetime
import inspect
from decimal import Decimal
from typing import Any,... | expected | added | a4640cd2b68d0447eae25a1ceb002ed7d9fe52272061e1f202380c78cb102b40 | assert|test_is_category|"""Tests a variety of python and pandas dtypes, and tests some specific coercion examples.""" # pylint doesn't know about __init__ generated with dataclass # pylint:disable=unexpected-keyword-arg,no-value-for-parameter import dataclasses import datetime import inspect from decimal import Decimal... | null | null | null |
unionai-oss/pandera | train | 218 | a0d95c7927d5f222dc3664e411a121499b6ebbdd | train | tests/core/test_dtypes.py | train | unionai-oss/pandera:tests/core/test_dtypes.py | 679 | 4 | assert | test_is_timedelta | """Tests a variety of python and pandas dtypes, and tests some specific
coercion examples."""
# pylint doesn't know about __init__ generated with dataclass
# pylint:disable=unexpected-keyword-arg,no-value-for-parameter
import dataclasses
import datetime
import inspect
from decimal import Decimal
from typing import Any,... | expected | added | 86ec1c39c566aa8951d258d0aa985f9bb59e3dbbaf3fe64a13925151286e8387 | assert|test_is_timedelta|"""Tests a variety of python and pandas dtypes, and tests some specific coercion examples.""" # pylint doesn't know about __init__ generated with dataclass # pylint:disable=unexpected-keyword-arg,no-value-for-parameter import dataclasses import datetime import inspect from decimal import Decima... | null | null | null |
unionai-oss/pandera | train | 219 | 285f4b9582df923b9be6e6313846db7ac60e1a75 | train | tests/core/test_schema_statistics.py | train | unionai-oss/pandera:tests/core/test_schema_statistics.py | 522 | 4 | assert | test_get_dataframe_schema_statistics | # pylint: disable=W0212
"""Unit tests for inferring statistics of pandas objects."""
import numpy as np
import pandas as pd
import pytest
import pandera as pa
import pandera.schema_statistics.pandas as schema_statistics
from pandera import dtypes
from pandera.engines import pandas_engine
DEFAULT_FLOAT = pandas_engine... | expectation | modified | be1b571e97e6e5e62d19ef638d752bb5c164fc636ba77d827f38688833c81416 | assert|test_get_dataframe_schema_statistics|# pylint: disable=W0212 """Unit tests for inferring statistics of pandas objects.""" import numpy as np import pandas as pd import pytest import pandera as pa import pandera.schema_statistics.pandas as schema_statistics from pandera import dtypes from pandera.engines import p... | expectation | 520 | 4 |
unionai-oss/pandera | train | 219 | 285f4b9582df923b9be6e6313846db7ac60e1a75 | train | tests/core/test_schema_statistics.py | train | unionai-oss/pandera:tests/core/test_schema_statistics.py | 536 | 4 | assert | test_get_series_schema_statistics | # pylint: disable=W0212
"""Unit tests for inferring statistics of pandas objects."""
import numpy as np
import pandas as pd
import pytest
import pandera as pa
import pandera.schema_statistics.pandas as schema_statistics
from pandera import dtypes
from pandera.engines import pandas_engine
DEFAULT_FLOAT = pandas_engine... | { "dtype": pandas_engine.Engine.dtype(int), "nullable": False, "checks": { "greater_than_or_equal_to": {"min_value": 0}, "less_than_or_equal_to": {"max_value": 100}, }, "name": None, "coerce": False, "unique": False, "description": None, "title": None, } | modified | 994012f4cdb4d6cebd5f651e1fff339af5a66281ce34566fee3c8879a90c908c | assert|test_get_series_schema_statistics|# pylint: disable=W0212 """Unit tests for inferring statistics of pandas objects.""" import numpy as np import pandas as pd import pytest import pandera as pa import pandera.schema_statistics.pandas as schema_statistics from pandera import dtypes from pandera.engines import pand... | { "dtype": pandas_engine.Engine.dtype(int), "nullable": False, "checks": { "greater_than_or_equal_to": {"min_value": 0}, "less_than_or_equal_to": {"max_value": 100}, }, "name": None, "coerce": False, "unique": False, } | 534 | 4 |
unionai-oss/pandera | train | 219 | 285f4b9582df923b9be6e6313846db7ac60e1a75 | train | tests/core/test_schema_statistics.py | train | unionai-oss/pandera:tests/core/test_schema_statistics.py | 649 | 4 | assert | test_parse_checks_and_statistics_roundtrip | # pylint: disable=W0212
"""Unit tests for inferring statistics of pandas objects."""
import numpy as np
import pandas as pd
import pytest
import pandera as pa
import pandera.schema_statistics.pandas as schema_statistics
from pandera import dtypes
from pandera.engines import pandas_engine
DEFAULT_FLOAT = pandas_engine... | expectation | modified | 4c337b70de1dc087f8a67e7b0283d0b722bb0e4844b14ead33c5e6ae3303a079 | assert|test_parse_checks_and_statistics_roundtrip|# pylint: disable=W0212 """Unit tests for inferring statistics of pandas objects.""" import numpy as np import pandas as pd import pytest import pandera as pa import pandera.schema_statistics.pandas as schema_statistics from pandera import dtypes from pandera.engines im... | set(checks) | 647 | 4 |
unionai-oss/pandera | train | 219 | 285f4b9582df923b9be6e6313846db7ac60e1a75 | train | tests/core/test_schema_statistics.py | train | unionai-oss/pandera:tests/core/test_schema_statistics.py | 665 | 4 | assert | test_parse_checks_and_statistics_no_param | # pylint: disable=W0212
"""Unit tests for inferring statistics of pandas objects."""
import numpy as np
import pandas as pd
import pytest
import pandera as pa
import pandera.schema_statistics.pandas as schema_statistics
from pandera import dtypes
from pandera.engines import pandas_engine
DEFAULT_FLOAT = pandas_engine... | expectation | modified | cdc096c7ccb91368feb24b4875a3033d3c56556e495b5ca786748e6acffacc55 | assert|test_parse_checks_and_statistics_no_param|# pylint: disable=W0212 """Unit tests for inferring statistics of pandas objects.""" import numpy as np import pandas as pd import pytest import pandera as pa import pandera.schema_statistics.pandas as schema_statistics from pandera import dtypes from pandera.engines imp... | set(checks) | 663 | 4 |
unionai-oss/pandera | train | 220 | c9e7a6e2f974e67c31dbeb7c5ba5e25b63d1c895 | train | tests/core/test_pandas_accessor.py | train | unionai-oss/pandera:tests/core/test_pandas_accessor.py | 45 | 8 | assert | test_dataframe_series_add_schema | """Unit tests for pandas_accessor module."""
from typing import Union
from unittest.mock import patch
import pandas as pd
import pytest
import pandera as pa
import pandera.api.pandas.container
from pandera.errors import BackendNotFoundError
@pytest.mark.parametrize(
"schema1, schema2, data, invalid_data",
[... | None | modified | be2c71e2674bb890e8393a90cc7ab01a00d5c988a71b7bd1489336ab15d3858d | assert|test_dataframe_series_add_schema|"""Unit tests for pandas_accessor module.""" from typing import Union from unittest.mock import patch import pandas as pd import pytest import pandera as pa import pandera.api.pandas.container from pandera.errors import BackendNotFoundError @pytest.mark.parametrize( "schema1, sch... | None | 44 | 8 |
unionai-oss/pandera | train | 220 | c9e7a6e2f974e67c31dbeb7c5ba5e25b63d1c895 | train | tests/core/test_pandas_accessor.py | train | unionai-oss/pandera:tests/core/test_pandas_accessor.py | 50 | 8 | assert | test_dataframe_series_add_schema | """Unit tests for pandas_accessor module."""
from typing import Union
from unittest.mock import patch
import pandas as pd
import pytest
import pandera as pa
import pandera.api.pandas.container
from pandera.errors import BackendNotFoundError
@pytest.mark.parametrize(
"schema1, schema2, data, invalid_data",
[... | schema2 | modified | 917078986f53e51ac4002afc8c4da0b2d93572dd706808a660da5c338a29963a | assert|test_dataframe_series_add_schema|"""Unit tests for pandas_accessor module.""" from typing import Union from unittest.mock import patch import pandas as pd import pytest import pandera as pa import pandera.api.pandas.container from pandera.errors import BackendNotFoundError @pytest.mark.parametrize( "schema1, sch... | schema2 | 49 | 8 |
unionai-oss/pandera | train | 220 | c9e7a6e2f974e67c31dbeb7c5ba5e25b63d1c895 | train | tests/core/test_schemas.py | test | unionai-oss/pandera:tests/core/test_schemas.py | 1,950 | 8 | assert | test_schema_level_unique_missing_columns | """Testing creation and manipulation of DataFrameSchema objects."""
# pylint: disable=too-many-lines,redefined-outer-name
import copy
from datetime import datetime, timedelta
from functools import partial
from typing import Any, Callable, Dict, List, Tuple, Type, Union
import numpy as np
import pandas as pd
import py... | errors.SchemaErrorReason.DUPLICATES | modified | de10cb28ff531a98e8b375ce20388a3384bf63704886c42d655b5f2ac4f6d95c | assert|test_schema_level_unique_missing_columns|"""Testing creation and manipulation of DataFrameSchema objects.""" # pylint: disable=too-many-lines,redefined-outer-name import copy from datetime import datetime, timedelta from functools import partial from typing import Any, Callable, Dict, List, Tuple, Type, Union im... | errors.SchemaErrorReason.DUPLICATES | 1,950 | 8 |
unionai-oss/pandera | train | 220 | c9e7a6e2f974e67c31dbeb7c5ba5e25b63d1c895 | train | tests/core/test_schemas.py | test | unionai-oss/pandera:tests/core/test_schemas.py | 1,971 | 4 | assert | test_column_set_unique | """Testing creation and manipulation of DataFrameSchema objects."""
# pylint: disable=too-many-lines,redefined-outer-name
import copy
from datetime import datetime, timedelta
from functools import partial
from typing import Any, Callable, Dict, List, Tuple, Type, Union
import numpy as np
import pandas as pd
import py... | not test_schema.columns["a"].unique | modified | 0117ed338cf05611ed08ad82f0dec80c417de60bca6ae2a36e0738d03ff0a253 | assert|test_column_set_unique|"""Testing creation and manipulation of DataFrameSchema objects.""" # pylint: disable=too-many-lines,redefined-outer-name import copy from datetime import datetime, timedelta from functools import partial from typing import Any, Callable, Dict, List, Tuple, Type, Union import numpy as np i... | not test_schema.columns["a"].unique | 1,971 | 4 |
unionai-oss/pandera | train | 220 | c9e7a6e2f974e67c31dbeb7c5ba5e25b63d1c895 | train | tests/core/test_schemas.py | test | unionai-oss/pandera:tests/core/test_schemas.py | 1,991 | 8 | assert | test_missing_columns | """Testing creation and manipulation of DataFrameSchema objects."""
# pylint: disable=too-many-lines,redefined-outer-name
import copy
from datetime import datetime, timedelta
from functools import partial
from typing import Any, Callable, Dict, List, Tuple, Type, Union
import numpy as np
import pandas as pd
import py... | [ "column3", "column2", ] | modified | dc590763c5bca1e530a0e413bfecf0a74e085c50f839a0bd5300f2542b5e48b3 | assert|test_missing_columns|"""Testing creation and manipulation of DataFrameSchema objects.""" # pylint: disable=too-many-lines,redefined-outer-name import copy from datetime import datetime, timedelta from functools import partial from typing import Any, Callable, Dict, List, Tuple, Type, Union import numpy as np imp... | [ "column3", "column2", ] | 1,991 | 8 |
unionai-oss/pandera | train | 220 | c9e7a6e2f974e67c31dbeb7c5ba5e25b63d1c895 | train | tests/io/test_io.py | train | unionai-oss/pandera:tests/io/test_io.py | 1,326 | 4 | assert | test_frictionless_schema_parses_correctly | """Unit tests for io module"""
import platform
import tempfile
from io import StringIO
from pathlib import Path
from unittest import mock
import pandas as pd
import pytest
from packaging import version
import pandera
import pandera.api.extensions as pa_ext
import pandera.typing as pat
from pandera.api.pandas.contain... | [ {"check": "column_in_schema", "failure_case": "unexpected_column"}, {"check": "column_in_dataframe", "failure_case": "date_col"}, { "check": "str_length(3, 80)", "failure_case": "dddddddddddddddddddddddddddddddddddddddddddddddddddd" "dddddddddddddddddddddddddddddddddddddddddddddddd", }, {"check": "isin([1.0, 2.0, 3.0... | modified | 57b53e31b3019ed5baaabc0e62915d833b3be9256b4ec5a83f247921bef3eb53 | assert|test_frictionless_schema_parses_correctly|"""Unit tests for io module""" import platform import tempfile from io import StringIO from pathlib import Path from unittest import mock import pandas as pd import pytest from packaging import version import pandera import pandera.api.extensions as pa_ext import pandera... | [ {"check": "column_in_dataframe", "failure_case": "date_col"}, {"check": "column_in_schema", "failure_case": "unexpected_column"}, { "check": "str_length(3, 80)", "failure_case": "dddddddddddddddddddddddddddddddddddddddddddddddddddd" "dddddddddddddddddddddddddddddddddddddddddddddddd", }, {"check": "isin([1.0, 2.0, 3.0... | 1,326 | 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.