Skip to content

Commit

Permalink
Add code for basic Column, and stub more modules
Browse files Browse the repository at this point in the history
Signed-off-by: Deepyaman Datta <[email protected]>
  • Loading branch information
deepyaman committed Dec 20, 2023
1 parent 1c7c682 commit ebd1675
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 3 deletions.
Empty file added pandera/api/ibis/__init__.py
Empty file.
7 changes: 7 additions & 0 deletions pandera/api/ibis/components.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""Core Ibis schema component specifications."""

from pandera.api.pandas.components import Column as _Column

Check warning on line 3 in pandera/api/ibis/components.py

View check run for this annotation

Codecov / codecov/patch

pandera/api/ibis/components.py#L3

Added line #L3 was not covered by tests


class Column(_Column):

Check warning on line 6 in pandera/api/ibis/components.py

View check run for this annotation

Codecov / codecov/patch

pandera/api/ibis/components.py#L6

Added line #L6 was not covered by tests
"""Validate types and properties of table columns."""
4 changes: 2 additions & 2 deletions pandera/api/ibis/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def validate(
sample: Optional[int] = None,
random_state: Optional[int] = None,
lazy: bool = False,
inplace: bool = false,
inplace: bool = False,
) -> ir.Table:
"""Validate an Ibis table against the schema.
Expand Down Expand Up @@ -50,7 +50,7 @@ def validate(
>>>
>>> df = pd.DataFrame({
... "probability": [0.1, 0.4, 0.52, 0.23, 0.8, 0.76],
... "category": ["dog", "dog", "cat", "duck", "dog", "dog"]
... "category": ["dog", "dog", "cat", "duck", "dog", "dog"],
... })
>>> t = ibis.memtable(df, name="t")
>>>
Expand Down
2 changes: 1 addition & 1 deletion pandera/api/pyspark/components.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Core pyspark schema component specifications."""
"""Core PySpark schema component specifications."""

from typing import Any, Dict, Iterable, Optional, Tuple, Union

Expand Down
5 changes: 5 additions & 0 deletions pandera/backends/ibis/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Ibis backend implementation for schemas and checks."""

from pandera.api.checks import Check
from pandera.api.ibis.container import DataFrameSchema
from pandera.api.ibis.components import Column

Check warning on line 5 in pandera/backends/ibis/__init__.py

View check run for this annotation

Codecov / codecov/patch

pandera/backends/ibis/__init__.py#L3-L5

Added lines #L3 - L5 were not covered by tests
6 changes: 6 additions & 0 deletions pandera/ibis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""A flexible and expressive Ibis validation library."""
# pylint: disable=unused-import
import pandera.backends.ibis
from pandera.api.checks import Check
from pandera.api.ibis.components import Column
from pandera.api.ibis.container import DataFrameSchema

Check warning on line 6 in pandera/ibis.py

View check run for this annotation

Codecov / codecov/patch

pandera/ibis.py#L3-L6

Added lines #L3 - L6 were not covered by tests

0 comments on commit ebd1675

Please sign in to comment.