repo_id
stringclasses
409 values
prefix
large_stringlengths
34
36.3k
target
large_stringlengths
1
498
assertion_type
stringclasses
31 values
difficulty
stringclasses
8 values
test_file
stringlengths
10
121
test_function
stringlengths
1
104
test_class
stringlengths
0
51
lineno
int32
2
11.3k
commit_idx
int32
unionai-oss/pandera
import re from collections.abc import Generator from typing import Any, Union import pytest from pandera.dtypes import DataType from pandera.engines.engine import Engine def equivalents() -> list[Any]: return [int, "int", 1] def engine() -> Generator[Engine, None, None]: class FakeEngine( metaclass=...
_DtypeA()
assert
func_call
tests/pandas/test_engine.py
test_register_dtype_overwrite
138
null
unionai-oss/pandera
import copy from collections.abc import Callable from datetime import datetime, timedelta from functools import partial from typing import Any, Union import numpy as np import pandas as pd import pytest from pandera.api.pandas.array import ArraySchema from pandera.dtypes import UniqueSettings from pandera.engines.pan...
key
assert
variable
tests/pandas/test_schemas.py
test_set_index_append
1,936
null
unionai-oss/pandera
import copy import pandas as pd import pytest from pandera.backends.pandas import error_formatters from pandera.pandas import ( Bool, Check, Column, DataFrameSchema, Float, Index, Int, SeriesSchema, String, errors, ) def test_check_groupby() -> None: """Tests uses of group...
2
assert
numeric_literal
tests/pandas/test_checks.py
test_check_groupby
71
null
unionai-oss/pandera
import asyncio import pickle import typing from contextlib import nullcontext from copy import deepcopy import numpy as np import pandas as pd import pytest from pandera.engines.pandas_engine import Engine from pandera.pandas import ( Check, Column, DataFrameModel, DataFrameSchema, DateTime, F...
None
assert
none_literal
tests/pandas/test_decorators.py
test_check_types_optional_out
734
null
unionai-oss/pandera
from typing import Optional import ibis import ibis.expr.datatypes as dt import ibis.expr.types as ir import pandas as pd import pytest from ibis import _ from ibis import selectors as s import pandera as pa from pandera.api.ibis.types import IbisData from pandera.dtypes import UniqueSettings from pandera.ibis import...
answers
assert
variable
tests/ibis/test_ibis_container.py
test_different_unique_settings
240
null
unionai-oss/pandera
from typing import Union from unittest.mock import patch import pandas as pd import pytest import pandera.api.pandas.container import pandera.pandas as pa from pandera.errors import BackendNotFoundError @pytest.mark.parametrize( "schema1, schema2, data, invalid_data", [ [ pa.DataFrameSche...
schema2
assert
variable
tests/pandas/test_pandas_accessor.py
test_dataframe_series_add_schema
54
null
unionai-oss/pandera
import ibis import ibis.expr.datatypes as dt import pytest from hypothesis import given, settings from hypothesis import strategies as st from ibis import _ from polars.testing import assert_frame_equal from polars.testing.parametric import dataframes import pandera.ibis as pa from pandera.engines import ibis_engine a...
pa.errors.SchemaError)
pytest.raises
complex_expr
tests/ibis/test_ibis_dtypes.py
test_ibis_map_type
191
null
unionai-oss/pandera
import copy import numpy as np import pandas as pd import pytest from pandas._testing import assert_frame_equal import pandera.pandas as pa from pandera.api.pandas.array import SeriesSchema from pandera.api.pandas.container import DataFrameSchema from pandera.api.parsers import Parser from pandera.typing import Serie...
4
assert
numeric_literal
tests/pandas/test_parsers.py
test_parser_with_coercion
132
null
unionai-oss/pandera
import asyncio import pickle import typing from contextlib import nullcontext from copy import deepcopy import numpy as np import pandas as pd import pytest from pandera.engines.pandas_engine import Engine from pandera.pandas import ( Check, Column, DataFrameModel, DataFrameSchema, DateTime, F...
2
assert
numeric_literal
tests/pandas/test_decorators.py
test_check_types_star_args
1,441
null
unionai-oss/pandera
import copy import pandas as pd import pytest from pandera.backends.pandas import error_formatters from pandera.pandas import ( Bool, Check, Column, DataFrameSchema, Float, Index, Int, SeriesSchema, String, errors, ) def test_reshape_failure_cases_exceptions() -> None: """...
TypeError)
pytest.raises
variable
tests/pandas/test_checks.py
test_reshape_failure_cases_exceptions
351
null
unionai-oss/pandera
import datetime import decimal from unittest import mock import pytest from pyspark.sql.functions import col from pyspark.sql.types import ( ArrayType, BooleanType, ByteType, DateType, DecimalType, DoubleType, FloatType, IntegerType, LongType, MapType, ShortType, StringT...
expected["SCHEMA"]
assert
complex_expr
tests/pyspark/test_pyspark_check.py
test_datatype_check_decorator
TestDecorator
139
null
unionai-oss/pandera
import multiprocessing import pickle from typing import NoReturn, cast import numpy as np import pandas as pd import pytest from pandera.config import ValidationDepth, config_context from pandera.engines import numpy_engine, pandas_engine from pandera.errors import ( ParserError, ReducedPickleExceptionBase, ...
str(exc_native)
assert
func_call
tests/pandas/test_errors.py
_compare_exception_with_unpickled
TestSchemaErrors
265
null
unionai-oss/pandera
import os import re import runpy from collections.abc import Iterable from copy import deepcopy from enum import Enum from typing import Any, Generic, Optional, TypeVar import numpy as np import pandas as pd import pytest from pandas._testing import assert_frame_equal import pandera.api.extensions as pax import pande...
3
assert
numeric_literal
tests/pandas/test_model.py
test_multiindex_check_has_context
373
null
unionai-oss/pandera
from dataclasses import asdict import pyspark.sql.types as T import pytest from pandera.config import ValidationDepth, config_context, get_config_context from pandera.pyspark import ( Check, Column, DataFrameModel, DataFrameSchema, Field, ) from tests.pyspark.conftest import spark_df pytestmark =...
expected
assert
variable
tests/pyspark/test_pyspark_config.py
test_schema_only
TestPanderaConfig
81
null
unionai-oss/pandera
from __future__ import annotations import typing import pandas as pd import pytest from pandas._testing import assert_frame_equal import pandera.pandas as pa def func(data: pa.typing.DataFrame[Model]) -> pa.typing.DataFrame[Model]: return data def test_forwardref_with_pandera_dataframe_generic_initialization()...
pa.errors.SchemaError)
pytest.raises
complex_expr
tests/pandas/test_schema_forwardref.py
test_forwardref_with_pandera_dataframe_generic_initialization
117
null
unionai-oss/pandera
from typing import Any import pytest import pandera.pandas as pa from pandera.engines.pandas_engine import Engine @pytest.mark.parametrize( "arg,value,expected", [ ("eq", 9, pa.Check.equal_to(9)), ("ne", 9, pa.Check.not_equal_to(9)), ("gt", 9, pa.Check.greater_than(9)), ("ge",...
1
assert
numeric_literal
tests/pandas/test_model_components.py
test_field_checks
82
null
unionai-oss/pandera
import datetime import decimal from collections.abc import Sequence from decimal import Decimal from typing import Union import polars as pl import pytest from hypothesis import given, settings from hypothesis import strategies as st from polars.testing import assert_frame_equal from polars.testing.parametric import d...
expected_dtype.scale
assert
complex_expr
tests/polars/test_polars_dtypes.py
test_polars_decimal_from_parametrized_dtype
345
null
unionai-oss/pandera
import multiprocessing import pickle from typing import NoReturn, cast import numpy as np import pandas as pd import pytest from pandera.config import ValidationDepth, config_context from pandera.engines import numpy_engine, pandas_engine from pandera.errors import ( ParserError, ReducedPickleExceptionBase, ...
"1337"
assert
string_literal
tests/pandas/test_errors.py
validate_unpickled
TestReducedPickleException
87
null
unionai-oss/pandera
import asyncio import pickle import typing from contextlib import nullcontext from copy import deepcopy import numpy as np import pandas as pd import pytest from pandera.engines.pandas_engine import Engine from pandera.pandas import ( Check, Column, DataFrameModel, DataFrameSchema, DateTime, F...
df)
assert_*
variable
tests/pandas/test_decorators.py
test_check_types_unchanged
616
null
unionai-oss/pandera
import re from collections.abc import Generator from typing import Any, Union import pytest from pandera.dtypes import DataType from pandera.engines.engine import Engine def equivalents() -> list[Any]: return [int, "int", 1] def engine() -> Generator[Engine, None, None]: class FakeEngine( metaclass=...
_DtypeB()
assert
func_call
tests/pandas/test_engine.py
test_register_dtype_overwrite
148
null
unionai-oss/pandera
import ibis import pytest import pandera.ibis as pa import pandera.typing.ibis as pa_typing def data() -> ibis.Table: return ibis.memtable({"a": [1, 2, 3]}) def invalid_data(data) -> ibis.Table: return data.rename({"b": "a"}) def test_ibis_dataframe_check_io(data, invalid_data): # pylint: disable=unused...
pa.errors.SchemaError)
pytest.raises
complex_expr
tests/ibis/test_ibis_decorators.py
test_ibis_dataframe_check_io
46
null
unionai-oss/pandera
import copy from typing import Any, Optional from unittest.mock import MagicMock, patch import numpy as np import pandas as pd import pytest from pandera.api.base.error_handler import ErrorHandler from pandera.backends.pandas.components import MultiIndexBackend from pandera.engines.pandas_engine import Engine, pandas...
"object"
assert
string_literal
tests/pandas/test_schema_components.py
tests_multi_index_subindex_coerce
374
null
unionai-oss/pandera
import asyncio import pickle import typing from contextlib import nullcontext from copy import deepcopy import numpy as np import pandas as pd import pytest from pandera.engines.pandas_engine import Engine from pandera.pandas import ( Check, Column, DataFrameModel, DataFrameSchema, DateTime, F...
"int64"
assert
string_literal
tests/pandas/test_decorators.py
test_check_decorator_coercion
233
null
unionai-oss/pandera
import multiprocessing import pickle from typing import NoReturn, cast import numpy as np import pandas as pd import pytest from pandera.config import ValidationDepth, config_context from pandera.engines import numpy_engine, pandas_engine from pandera.errors import ( ParserError, ReducedPickleExceptionBase, ...
str(df)
assert
func_call
tests/pandas/test_errors.py
_validate_error
TestSchemaError
191
null
unionai-oss/pandera
import re from collections.abc import Generator from typing import Any, Union import pytest from pandera.dtypes import DataType from pandera.engines.engine import Engine def equivalents() -> list[Any]: return [int, "int", 1] def engine() -> Generator[Engine, None, None]: class FakeEngine( metaclass=...
"foo"
assert
string_literal
tests/pandas/test_engine.py
test_register_dtype_complete
117
null
unionai-oss/pandera
import ibis import ibis.expr.datatypes as dt import pytest from hypothesis import given, settings from hypothesis import strategies as st from ibis import _ from polars.testing import assert_frame_equal from polars.testing.parametric import dataframes import pandera.ibis as pa from pandera.engines import ibis_engine a...
equivalent
assert
variable
tests/ibis/test_ibis_dtypes.py
test_check_equivalent_custom
122
null
unionai-oss/pandera
import dataclasses import datetime import inspect import re import sys from decimal import Decimal from typing import Any, NamedTuple import hypothesis import numpy as np import pandas as pd import pytest from _pytest.mark.structures import ParameterSet from _pytest.python import Metafunc from hypothesis import strate...
3
assert
numeric_literal
tests/pandas/test_dtypes.py
test_numpy_string
568
null
unionai-oss/pandera
import re from collections.abc import Generator from typing import Any, Union import pytest from pandera.dtypes import DataType from pandera.engines.engine import Engine def equivalents() -> list[Any]: return [int, "int", 1] def engine() -> Generator[Engine, None, None]: class FakeEngine( metaclass=...
SimpleDtype()
assert
func_call
tests/pandas/test_engine.py
test_return_base_dtype
177
null
unionai-oss/pandera
import io import sys from unittest.mock import MagicMock, patch import ibis import pytest import pandera.ibis as pa from pandera.typing.formats import Formats from pandera.typing.ibis import Table, ibis_version class TestTable: def test_from_format_json(self): """Test from_format with JSON format.""" ...
json_str)
assert_*
variable
tests/ibis/test_ibis_typing.py
test_from_format_json
TestTable
198
null
unionai-oss/pandera
from collections.abc import Iterable from datetime import date, datetime from decimal import Decimal from typing import cast import modin.pandas as mpd import numpy as np import pandas as pd import pytest from pandas.testing import assert_series_equal import pandera.pandas as pa from pandera.engines import pandas_eng...
True
assert
bool_literal
tests/modin/test_logical_dtypes.py
test_logical_datatype_check
76
null
unionai-oss/pandera
from typing import Union import dask.dataframe as dd import pandas as pd import pytest import pandera.pandas as pa @pytest.mark.parametrize( "schema1, schema2, data, invalid_data", [ [ pa.DataFrameSchema({"col": pa.Column(int)}, coerce=True), pa.DataFrameSchema({"col": pa.Colu...
schema2
assert
variable
tests/dask/test_dask_accessor.py
test_dataframe_series_add_schema
52
null
unionai-oss/pandera
import copy from typing import Any, Optional from unittest.mock import MagicMock, patch import numpy as np import pandas as pd import pytest from pandera.api.base.error_handler import ErrorHandler from pandera.backends.pandas.components import MultiIndexBackend from pandera.engines.pandas_engine import Engine, pandas...
[None]
assert
collection
tests/pandas/test_schema_components.py
test_index_schema
83
null
unionai-oss/pandera
import io import sys from unittest.mock import MagicMock, patch import polars as pl import pytest import pandera.polars as pa from pandera.engines import PYDANTIC_V2 from pandera.errors import SchemaInitError from pandera.typing.formats import Formats from pandera.typing.polars import DataFrame, Series, polars_versio...
buffer)
assert_*
variable
tests/polars/test_polars_typing.py
test_to_format_callable
TestDataFrame
351
null
unionai-oss/pandera
import dataclasses import datetime import inspect import re import sys from decimal import Decimal from typing import Any, NamedTuple import hypothesis import numpy as np import pandas as pd import pytest from _pytest.mark.structures import ParameterSet from _pytest.python import Metafunc from hypothesis import strate...
["1.0", 2.0]
assert
collection
tests/pandas/test_dtypes.py
test_python_std_list_dict_error
947
null
unionai-oss/pandera
import numpy as np import pandas as pd import pytest from pandera.engines import utils @pytest.mark.parametrize( "data_container", [ pd.Series([1, 2, 3, 4]), np.array([1, 2, 3, 4]), pd.DataFrame({0: [1, 2, 3, 4]}), np.array([[1], [2], [3], [4]]), ], ) def test_numpy_pandas_...
None
assert
none_literal
tests/pandas/test_engine_utils.py
test_numpy_pandas_coerce_failure_cases
45
null
unionai-oss/pandera
import polars as pl import pytest import pandera.polars as pa from pandera.api.base.error_handler import ErrorCategory from pandera.api.polars.utils import get_lazyframe_schema from pandera.config import ( CONFIG, ValidationDepth, config_context, get_config_context, get_config_global, reset_con...
[{"a": "foo"}]
assert
collection
tests/polars/test_polars_config.py
test_coerce_validation_depth_none
199
null
unionai-oss/pandera
import typing from unittest.mock import MagicMock import modin.pandas as mpd import pandas as pd import pytest import pandera.pandas as pa from pandera import extensions from pandera.engines import numpy_engine, pandas_engine from pandera.typing.modin import DataFrame, Index, Series, modin_version from tests.strategi...
0
assert
numeric_literal
tests/modin/test_schemas_on_modin.py
test_nullable
183
null
unionai-oss/pandera
import geopandas as gpd import numpy as np import pandas as pd import pytest import shapely from shapely.geometry import Point import pandera.pandas as pa from pandera.engines.geopandas_engine import Geometry from pandera.engines.pandas_engine import DateTime def test_engine_geometry_equality(): """Test Geometry ...
TypeError)
pytest.raises
variable
tests/geopandas/test_engine.py
test_engine_geometry_equality
31
null
unionai-oss/pandera
import geopandas as gpd import pandas as pd import pytest from shapely.geometry import Point, Polygon import pandera.pandas as pa from pandera.engines.geopandas_engine import Geometry from pandera.typing import Series from pandera.typing.geopandas import GeoDataFrame, GeoSeries def test_schema_multiple_geometry_same_...
data["geometry"])
assert_*
complex_expr
tests/geopandas/test_geopandas.py
test_schema_multiple_geometry_same_crs
204
null
unionai-oss/pandera
import re from typing import Any, Optional import numpy as np import pandas as pd import pytest import pandera.pandas as pa from pandera.dtypes import DataType from pandera.typing import DataFrame, Index, Series def _test_literal_pandas_dtype( model: type[pa.DataFrameModel], pandas_dtype: DataType ): schema ...
pa.errors.SchemaError)
pytest.raises
complex_expr
tests/pandas/test_typing.py
test_init_pandas_dataframe_errors
515
null
unionai-oss/pandera
import asyncio import pickle import typing from contextlib import nullcontext from copy import deepcopy import numpy as np import pandas as pd import pytest from pandera.engines.pandas_engine import Engine from pandera.pandas import ( Check, Column, DataFrameModel, DataFrameSchema, DateTime, F...
expect
assert
variable
tests/pandas/test_decorators.py
_assert_equals
426
null
unionai-oss/pandera
import typing from unittest.mock import MagicMock import modin.pandas as mpd import pandas as pd import pytest import pandera.pandas as pa from pandera import extensions from pandera.engines import numpy_engine, pandas_engine from pandera.typing.modin import DataFrame, Index, Series, modin_version from tests.strategi...
to_dtype
assert
variable
tests/modin/test_schemas_on_modin.py
test_dtype_coercion
257
null
unionai-oss/pandera
import logging from contextlib import nullcontext as does_not_raise import pyspark.sql.types as T import pytest from pyspark.sql import DataFrame from pandera.backends.pyspark.decorators import cache_check_obj from pandera.config import config_context from pandera.pyspark import Check, Column, DataFrameSchema from te...
caplog.text
assert
complex_expr
tests/pyspark/test_pyspark_decorators.py
test_cache_dataframe_settings
TestPanderaDecorators
115
null
unionai-oss/pandera
import re from typing import Any, Optional import numpy as np import pandas as pd import pytest import pandera.pandas as pa from pandera.dtypes import DataType from pandera.typing import DataFrame, Index, Series def _test_literal_pandas_dtype( model: type[pa.DataFrameModel], pandas_dtype: DataType ): schema ...
expected
assert
variable
tests/pandas/test_typing.py
_test_literal_pandas_dtype
133
null
unionai-oss/pandera
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, TransactionsOut def app(): """Transient app server for testing.""" # pylint: disable=consider-using-with process ...
"file"
assert
string_literal
tests/fastapi/test_app.py
test_upload_file_endpoint
77
null
unionai-oss/pandera
import asyncio import pickle import typing from contextlib import nullcontext from copy import deepcopy import numpy as np import pandas as pd import pytest from pandera.engines.pandas_engine import Engine from pandera.pandas import ( Check, Column, DataFrameModel, DataFrameSchema, DateTime, F...
1
assert
numeric_literal
tests/pandas/test_decorators.py
test_check_types_star_args
1,442
null
unionai-oss/pandera
import io import tempfile from typing import Any import pandas as pd import pytest import pandera.pandas as pa from pandera.engines import pandas_engine def custom_to_csv(data: Any, *args, **kwargs): """ Function to save data to csv, used in to_format function. Args: data: The data object to be ...
pa.errors.SchemaError)
pytest.raises
complex_expr
tests/pandas/test_from_to_format_conversions.py
test_to_format
305
null
unionai-oss/pandera
import asyncio import pickle import typing from contextlib import nullcontext from copy import deepcopy import numpy as np import pandas as pd import pytest from pandera.engines.pandas_engine import Engine from pandera.pandas import ( Check, Column, DataFrameModel, DataFrameSchema, DateTime, F...
kwarg)
assert_*
variable
tests/pandas/test_decorators.py
test_check_types_star_args_kwargs
1,522
null
unionai-oss/pandera
import datetime import decimal from unittest import mock import pytest from pyspark.sql.functions import col from pyspark.sql.types import ( ArrayType, BooleanType, ByteType, DateType, DecimalType, DoubleType, FloatType, IntegerType, LongType, MapType, ShortType, StringT...
expected["DATA"]
assert
complex_expr
tests/pyspark/test_pyspark_check.py
test_datatype_check_decorator
TestDecorator
138
null
unionai-oss/pandera
import datetime import decimal from collections.abc import Sequence from decimal import Decimal from typing import Union import polars as pl import pytest from hypothesis import given, settings from hypothesis import strategies as st from polars.testing import assert_frame_equal from polars.testing.parametric import d...
pandera_dtype.type
assert
complex_expr
tests/polars/test_polars_dtypes.py
test_coerce_cast_special
171
null
unionai-oss/pandera
import copy import pandas as pd import pytest from pandera.backends.pandas import error_formatters from pandera.pandas import ( Bool, Check, Column, DataFrameSchema, Float, Index, Int, SeriesSchema, String, errors, ) def test_check_equality_operators() -> None: """Test the...
copy.deepcopy(check)
assert
func_call
tests/pandas/test_checks.py
test_check_equality_operators
364
null
unionai-oss/pandera
from typing import Annotated, Optional import polars as pl import pytest from hypothesis import given from hypothesis import strategies as st from polars.testing import assert_frame_equal from polars.testing.parametric import column, dataframes import pandera.polars as pa from pandera import Check as C from pandera.a...
pa.errors.SchemaError)
pytest.raises
complex_expr
tests/polars/test_polars_container.py
test_coerce_column_dtype_error
158
null
unionai-oss/pandera
import datetime import operator import re from collections.abc import Callable from typing import Any, Optional from unittest.mock import MagicMock from warnings import catch_warnings import numpy as np import pandas as pd import pytest import pandera.pandas as pa from pandera.api.checks import Check from pandera.api...
values
assert
variable
tests/strategies/test_strategies.py
test_isin_notin_strategies
320
null
unionai-oss/pandera
import pytest from pandera.backends.base import CoreCheckResult from pandera.config import ValidationDepth, ValidationScope, config_context from pandera.validation_depth import validate_scope def custom_backend(): class CustomBackend: # pylint: disable=unused-argument @validate_scope(ValidationSco...
expected
assert
variable
tests/pandas/test_validation_depth.py
test_validate_scope
44
null
unionai-oss/pandera
from __future__ import annotations import typing import pandas as pd import pytest from pandas._testing import assert_frame_equal import pandera.pandas as pa def func(data: pa.typing.DataFrame[Model]) -> pa.typing.DataFrame[Model]: return data def test_forwardref_with_pandera_dataframe_generic_initialization()...
expected)
assert_*
variable
tests/pandas/test_schema_forwardref.py
test_forwardref_with_pandera_dataframe_generic_initialization
115
null
unionai-oss/pandera
import copy import numpy as np import pandas as pd import pytest from pandas._testing import assert_frame_equal import pandera.pandas as pa from pandera.api.pandas.array import SeriesSchema from pandera.api.pandas.container import DataFrameSchema from pandera.api.parsers import Parser from pandera.typing import Serie...
pd.Int64Dtype()
assert
func_call
tests/pandas/test_parsers.py
test_parser_with_coercion
131
null
unionai-oss/pandera
import numpy as np import pandas as pd from joblib import Parallel, delayed import pandera.pandas as pa def validate_df(df): validated_df = Model.to_schema().validate(df) assert validated_df.dtypes["time"] ==
np.float32
assert
complex_expr
tests/pandas/test_multithreaded.py
validate_df
16
null
unionai-oss/pandera
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.container import DataFrameSchema from p...
1
assert
numeric_literal
tests/io/test_pandas_io.py
test_to_yaml_registered_dataframe_check
1,498
null
unionai-oss/pandera
from typing import Union import dask.dataframe as dd import pandas as pd import pytest import pandera.pandas as pa @pytest.mark.parametrize( "schema1, schema2, data, invalid_data", [ [ pa.DataFrameSchema({"col": pa.Column(int)}, coerce=True), pa.DataFrameSchema({"col": pa.Colu...
None
assert
none_literal
tests/dask/test_dask_accessor.py
test_dataframe_series_add_schema
44
null
unionai-oss/pandera
import copy from typing import Any, Optional from unittest.mock import MagicMock, patch import numpy as np import pandas as pd import pytest from pandera.api.base.error_handler import ErrorHandler from pandera.backends.pandas.components import MultiIndexBackend from pandera.engines.pandas_engine import Engine, pandas...
default
assert
variable
tests/pandas/test_schema_components.py
test_column_default_works_when_dtype_match
1,449
null
unionai-oss/pandera
from typing import Any import pytest import pandera.pandas as pa from pandera.engines.pandas_engine import Engine def test_field_in_range_tuple(): """Test that Field(in_range=(min, max)) works correctly.""" import pandas as pd # Test with tuple (positional args style) field_tuple = pa.Field(in_range...
checks_dict[0]
assert
complex_expr
tests/pandas/test_model_components.py
test_field_in_range_tuple
141
null
unionai-oss/pandera
from contextlib import nullcontext as does_not_raise from typing import Optional import pyspark.sql.types as T import pytest from pyspark.sql import DataFrame import pandera import pandera.api.extensions as pax import pandera.pyspark as pa from pandera.api.pyspark.model import docstring_substitution from pandera.conf...
["a", "b"]
assert
collection
tests/pyspark/test_pyspark_model.py
test_dataframe_schema_strict
377
null
unionai-oss/pandera
from dataclasses import asdict import pandas as pd import pytest import pandera.pandas as pa from pandera.config import ValidationDepth, config_context, get_config_context from pandera.pandas import DataFrameModel, DataFrameSchema, SeriesSchema def disable_validation(): """Fixture to disable validation and clean...
self.sample_data
assert
complex_expr
tests/pandas/test_pandas_config.py
test_disable_validation
TestPandasDataFrameConfig
54
null
unionai-oss/pandera
import pyspark.sql.types as T import pytest from pyspark.sql.types import StringType import pandera.pyspark as pa from pandera.api.base import error_handler from pandera.errors import SchemaError, SchemaErrorReason from pandera.pyspark import Column, DataFrameModel, DataFrameSchema, Field from tests.pyspark.conftest i...
expected["DATA"]
assert
complex_expr
tests/pyspark/test_pyspark_error.py
test_pyspark_schema_data_checks
168
null
unionai-oss/pandera
import datetime import operator import re from collections.abc import Callable from typing import Any, Optional from unittest.mock import MagicMock from warnings import catch_warnings import numpy as np import pandas as pd import pytest import pandera.pandas as pa from pandera.api.checks import Check from pandera.api...
size
assert
variable
tests/strategies/test_strategies.py
test_defined_check_strategy
939
null
unionai-oss/pandera
from typing import Any import pytest import pandera.pandas as pa from pandera.engines.pandas_engine import Engine def test_field_isin_list_and_tuple(): """Test that Field(isin=list) and Field(isin=tuple) both work correctly.""" import pandas as pd # Test with list field_list = pa.Field(isin=[1, 2, 3...
pa.errors.SchemaError)
pytest.raises
complex_expr
tests/pandas/test_model_components.py
test_field_isin_list_and_tuple
120
null
unionai-oss/pandera
import polars as pl import pytest import pandera.polars as pa import pandera.typing.polars as pa_typing def data() -> pl.DataFrame: return pl.DataFrame({"a": [1, 2, 3]}) def invalid_data(data) -> pl.DataFrame: return data.rename({"a": "b"}) def test_polars_dataframe_check_io(data, invalid_data): # pylin...
pa.errors.SchemaError)
pytest.raises
complex_expr
tests/polars/test_polars_decorators.py
test_polars_dataframe_check_io
46
null
unionai-oss/pandera
import geopandas as gpd import pandas as pd import pytest from pydantic import BaseModel, ValidationError from shapely.geometry import Point import pandera.pandas as pa from pandera.typing.geopandas import GeoDataFrame, GeoSeries def test_pydantic_active_geometry(): """Test that GeoDataFrame type can be used in a...
"geometry"
assert
string_literal
tests/geopandas/test_pydantic.py
test_pydantic_active_geometry
34
null
unionai-oss/pandera
import datetime as dt from typing import Any, Optional import hypothesis import hypothesis.extra.pandas as pd_st import hypothesis.strategies as st import numpy as np import pandas as pd import pyarrow import pytest import pytz from hypothesis import given from pandera.engines import pandas_engine from pandera.errors...
0
assert
numeric_literal
tests/pandas/test_pandas_engine.py
test_pandas_data_type_coerce
84
null
unionai-oss/pandera
import datetime import decimal from collections.abc import Sequence from decimal import Decimal from typing import Union import polars as pl import pytest from hypothesis import given, settings from hypothesis import strategies as st from polars.testing import assert_frame_equal from polars.testing.parametric import d...
coerced)
assert_*
variable
tests/polars/test_polars_dtypes.py
test_coerce_no_cast
89
null
unionai-oss/pandera
import datetime import decimal from collections.abc import Sequence from decimal import Decimal from typing import Union import polars as pl import pytest from hypothesis import given, settings from hypothesis import strategies as st from polars.testing import assert_frame_equal from polars.testing.parametric import d...
shape
assert
variable
tests/polars/test_polars_dtypes.py
test_polars_from_parametrized_nested_dtype
505
null
unionai-oss/pandera
import pandas as pd import pytest from pydantic import BaseModel import pandera.pandas as pa from pandera.api.pandas.array import ArraySchema from pandera.engines.pandas_engine import PydanticModel @pytest.mark.parametrize("coerce", [True, False]) def test_pydantic_model_coerce(coerce: bool): """Test that DataFra...
True
assert
bool_literal
tests/pandas/test_pydantic_dtype.py
test_pydantic_model_coerce
91
null
unionai-oss/pandera
from collections.abc import Iterable from datetime import date, datetime from decimal import Decimal from typing import Any, cast import numpy as np import pandas as pd import pytest from pandas.testing import assert_series_equal import pandera.pandas as pa from pandera.engines import pandas_engine from pandera.error...
True
assert
bool_literal
tests/pandas/test_logical_dtypes.py
test_logical_datatype_check
75
null
unionai-oss/pandera
import polars as pl from joblib import Parallel, delayed from pandera.polars import Column, DataFrameSchema schema = DataFrameSchema({"a": Column(pl.Int32)}, coerce=True) def test_polars_parallel(): def fn(): return schema.validate(pl.DataFrame({"a": [1]})) results = Parallel(2)([delayed(fn)() for _...
pl.Int32
assert
complex_expr
tests/polars/test_polars_parallel.py
test_polars_parallel
18
null
unionai-oss/pandera
import asyncio import pickle import typing from contextlib import nullcontext from copy import deepcopy import numpy as np import pandas as pd import pytest from pandera.engines.pandas_engine import Engine from pandera.pandas import ( Check, Column, DataFrameModel, DataFrameSchema, DateTime, F...
arg)
assert_*
variable
tests/pandas/test_decorators.py
test_check_types_star_args_kwargs
1,521
null
unionai-oss/pandera
from dataclasses import asdict import pandas as pd import pytest import pandera.pandas as pa from pandera.config import ValidationDepth, config_context, get_config_context from pandera.pandas import DataFrameModel, DataFrameSchema, SeriesSchema def disable_validation(): """Fixture to disable validation and clean...
expected
assert
variable
tests/pandas/test_pandas_config.py
test_disable_validation
TestPandasDataFrameConfig
53
null
unionai-oss/pandera
import datetime as dt from typing import Any, Optional import hypothesis import hypothesis.extra.pandas as pd_st import hypothesis.strategies as st import numpy as np import pandas as pd import pyarrow import pytest import pytz from hypothesis import given from pandera.engines import pandas_engine from pandera.errors...
dtype.type
assert
complex_expr
tests/pandas/test_pandas_engine.py
test_pandas_arrow_dtype
456
null
unionai-oss/pandera
import pickle from collections.abc import Iterable import pandas as pd import pytest from pandera.backends.pandas.register import register_pandas_backends register_pandas_backends("pandera.typing.pandas.Series") from pandera.api.checks import Check from pandera.api.pandas.array import SeriesSchema from pandera.api....
series
assert
variable
tests/pandas/test_checks_builtin.py
check_none_failures
64
null
unionai-oss/pandera
import typing from unittest.mock import MagicMock import modin.pandas as mpd import pandas as pd import pytest import pandera.pandas as pa from pandera import extensions from pandera.engines import numpy_engine, pandas_engine from pandera.typing.modin import DataFrame, Index, Series, modin_version from tests.strategi...
"object"
assert
string_literal
tests/modin/test_schemas_on_modin.py
test_index_dtypes
144
null
unionai-oss/pandera
import multiprocessing import pickle from typing import NoReturn, cast import numpy as np import pandas as pd import pytest from pandera.config import ValidationDepth, config_context from pandera.engines import numpy_engine, pandas_engine from pandera.errors import ( ParserError, ReducedPickleExceptionBase, ...
0
assert
numeric_literal
tests/pandas/test_errors.py
_validate_error
TestSchemaError
202
null
unionai-oss/pandera
import polars as pl import pytest import pandera.polars as pa from pandera.typing.polars import LazyFrame, Series def test_series_annotation(): class Model(pa.DataFrameModel): col1: Series[pl.Int64] data = pl.LazyFrame( { "col1": [1, 2, 3], } ) assert data.collect...
pa.errors.SchemaError)
pytest.raises
complex_expr
tests/polars/test_polars_dataframe_generic.py
test_series_annotation
23
null
unionai-oss/pandera
import io import sys from unittest.mock import MagicMock, patch import ibis import pytest import pandera.ibis as pa from pandera.typing.formats import Formats from pandera.typing.ibis import Table, ibis_version class TestTable: def test_to_format_callable(self): """Test to_format with a callable.""" ...
buffer
assert
variable
tests/ibis/test_ibis_typing.py
test_to_format_callable
TestTable
324
null
unionai-oss/pandera
from dataclasses import asdict import pyspark.sql.types as T import pytest from pandera.config import ValidationDepth, config_context, get_config_context from pandera.pyspark import ( Check, Column, DataFrameModel, DataFrameSchema, Field, ) from tests.pyspark.conftest import spark_df pytestmark =...
input_df
assert
variable
tests/pyspark/test_pyspark_config.py
test_disable_validation
TestPanderaConfig
56
null
unionai-oss/pandera
import dataclasses import datetime import inspect import re import sys from decimal import Decimal from typing import Any, NamedTuple import hypothesis import numpy as np import pandas as pd import pytest from _pytest.mark.structures import ParameterSet from _pytest.python import Metafunc from hypothesis import strate...
expected
assert
variable
tests/pandas/test_dtypes.py
test_coerce_dt
496
null
unionai-oss/pandera
from typing import Any, Optional, Union import pandas as pd import pytest import pandera.pandas as pa import pandera.strategies.pandas_strategies as st from pandera import DataType, extensions from pandera.api.checks import Check from pandera.backends.pandas.register import register_pandas_backends def register_pand...
0
assert
numeric_literal
tests/pandas/test_extensions.py
test_register_check_with_strategy
234
null
unionai-oss/pandera
from contextlib import nullcontext as does_not_raise from typing import Optional import pyspark.sql.types as T import pytest from pyspark.sql import DataFrame import pandera import pandera.api.extensions as pax import pandera.pyspark as pa from pandera.api.pyspark.model import docstring_substitution from pandera.conf...
pa.PysparkSchemaError)
pytest.raises
complex_expr
tests/pyspark/test_pyspark_model.py
test_dataframe_schema_strict
367
null
unionai-oss/pandera
from contextlib import nullcontext as does_not_raise from typing import Optional import pyspark.sql.types as T import pytest from pyspark.sql import DataFrame import pandera import pandera.api.extensions as pax import pandera.pyspark as pa from pandera.api.pyspark.model import docstring_substitution from pandera.conf...
pa.SchemaInitError)
pytest.raises
complex_expr
tests/pyspark/test_pyspark_model.py
test_dataframe_schema_strict
379
null
unionai-oss/pandera
import io import sys from unittest.mock import MagicMock, patch import ibis import pytest import pandera.ibis as pa from pandera.typing.formats import Formats from pandera.typing.ibis import Table, ibis_version class TestTable: def test_to_format_dict(self): """Test to_format with dict format.""" ...
result
assert
variable
tests/ibis/test_ibis_typing.py
test_to_format_dict
TestTable
337
null
unionai-oss/pandera
import dataclasses import datetime import inspect import re import sys from decimal import Decimal from typing import Any, NamedTuple import hypothesis import numpy as np import pandas as pd import pytest from _pytest.mark.structures import ParameterSet from _pytest.python import Metafunc from hypothesis import strate...
"binary"
assert
string_literal
tests/pandas/test_dtypes.py
test_is_binary
729
null
unionai-oss/pandera
import io import sys from unittest.mock import MagicMock, patch import ibis import pytest import pandera.ibis as pa from pandera.typing.formats import Formats from pandera.typing.ibis import Table, ibis_version class TestTable: def test_from_format_callable(self): """Test from_format with a callable."""...
t
assert
variable
tests/ibis/test_ibis_typing.py
test_from_format_callable
TestTable
137
null
unionai-oss/pandera
import copy from typing import Any, Optional from unittest.mock import MagicMock, patch import numpy as np import pandas as pd import pytest from pandera.api.base.error_handler import ErrorHandler from pandera.backends.pandas.components import MultiIndexBackend from pandera.engines.pandas_engine import Engine, pandas...
error)
pytest.raises
variable
tests/pandas/test_schema_components.py
test_column_regex_matching
586
null
unionai-oss/pandera
from contextlib import nullcontext as does_not_raise from typing import Optional import pyspark.sql.types as T import pytest from pyspark.sql import DataFrame import pandera import pandera.api.extensions as pax import pandera.pyspark as pa from pandera.api.pyspark.model import docstring_substitution from pandera.conf...
{}
assert
collection
tests/pyspark/test_pyspark_model.py
test_validation_succeeds_with_missing_optional_column
476
null
unionai-oss/pandera
import typing from unittest.mock import MagicMock import modin.pandas as mpd import pandas as pd import pytest import pandera.pandas as pa from pandera import extensions from pandera.engines import numpy_engine, pandas_engine from pandera.typing.modin import DataFrame, Index, Series, modin_version from tests.strategi...
pa.errors.SchemaError)
pytest.raises
complex_expr
tests/modin/test_schemas_on_modin.py
test_nullable
185
null
unionai-oss/pandera
import dataclasses import datetime import inspect import re import sys from decimal import Decimal from typing import Any, NamedTuple import hypothesis import numpy as np import pandas as pd import pytest from _pytest.mark.structures import ParameterSet from _pytest.python import Metafunc from hypothesis import strate...
TypeError)
pytest.raises
variable
tests/pandas/test_dtypes.py
test_invalid_pandas_extension_dtype
304
null
unionai-oss/pandera
import geopandas as gpd import numpy as np import pandas as pd import pytest import shapely from shapely.geometry import Point import pandera.pandas as pa from pandera.engines.geopandas_engine import Geometry from pandera.engines.pandas_engine import DateTime def test_engine_geometry_simple(): """Test Geometry fo...
"geometry"
assert
string_literal
tests/geopandas/test_engine.py
test_engine_geometry_simple
19
null
unionai-oss/pandera
from typing import Any import pytest import pandera.pandas as pa from pandera.engines.pandas_engine import Engine @pytest.mark.parametrize( "arg,value,expected", [ ("eq", 9, pa.Check.equal_to(9)), ("ne", 9, pa.Check.not_equal_to(9)), ("gt", 9, pa.Check.greater_than(9)), ("ge",...
expected
assert
variable
tests/pandas/test_model_components.py
test_field_checks
83
null
unionai-oss/pandera
from typing import Union import pytest from pyspark.sql import Column, DataFrame, SparkSession from pyspark.sql.functions import col from pyspark.sql.types import FloatType, LongType import pandera.pyspark as pa from pandera.config import PanderaConfig, ValidationDepth from pandera.pyspark import pyspark_sql_accessor...
schema1
assert
variable
tests/pyspark/test_pyspark_accessor.py
test_dataframe_add_schema
41
null
unionai-oss/pandera
import importlib import os import re import subprocess import sys from pathlib import Path import pytest import pandera.pandas as pa from tests.mypy.pandas_modules import pandas_dataframe test_module_dir = Path(os.path.dirname(__file__)) def _get_mypy_errors( module_name: str, stdout, ) -> list[dict[str, st...
len(errors)
assert
func_call
tests/mypy/test_pandas_static_type_checking.py
test_mypy_pandas_dataframe
82
null
unionai-oss/pandera
import copy import pandas as pd import pytest from pandera.backends.pandas import error_formatters from pandera.pandas import ( Bool, Check, Column, DataFrameSchema, Float, Index, Int, SeriesSchema, String, errors, ) def test_check_output_dtype_with_empty_datetime(): from ...
bool
assert
variable
tests/pandas/test_checks.py
test_check_output_dtype_with_empty_datetime
522
null
unionai-oss/pandera
import importlib import os import re import subprocess import sys from pathlib import Path import pytest import pandera.pandas as pa from tests.mypy.pandas_modules import pandas_dataframe test_module_dir = Path(os.path.dirname(__file__)) def _get_mypy_errors( module_name: str, stdout, ) -> list[dict[str, st...
"age"
assert
string_literal
tests/mypy/test_pandas_static_type_checking.py
test_pandera_runtime_errors
105
null