Skip to content

Commit

Permalink
remove pandera dependencies in src
Browse files Browse the repository at this point in the history
  • Loading branch information
francesco086 committed Oct 30, 2023
1 parent 3db5067 commit 7592336
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup python 🐍
uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: '3.12'
- name: Setup cache 💾
uses: actions/cache@v3
with:
Expand All @@ -39,7 +39,7 @@ jobs:
strategy:
matrix:
os: ["ubuntu-latest"]
version: ["3.9", "3.10", "3.11"]
version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout 🔖
uses: actions/checkout@v3
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
- name: Setup python 🐍
uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.12"
- name: Prepare release 🙆‍♂️📦test
run: |
python -m venv venv || . venv/bin/activate
Expand Down
10 changes: 4 additions & 6 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ stages:
- verification
- deployment


check style:
stage: verification
before_script:
Expand All @@ -13,7 +12,6 @@ check style:
script:
- pre-commit run


test:
image: $image
stage: verification
Expand All @@ -25,10 +23,10 @@ test:
parallel:
matrix:
- image:
- "python:3.9"
- "python:3.10"
- "python:3.11"

- "python:3.9"
- "python:3.10"
- "python:3.11"
- "python:3.12"

deploy package:
stage: deployment
Expand Down
11 changes: 3 additions & 8 deletions src/dac/_input/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
from pathlib import Path
from typing import Optional

import pandera as pa

from dac._file_helper import temporarily_copied_file
from dac._input.interface import Validator
from dac._input.pyproject import PyProjectConfig


Expand Down Expand Up @@ -65,7 +64,7 @@ def _check_schema_contains_expected_class(self) -> None:
) from e

try:
issubclass(pkg.Schema, pa.SchemaModel)
issubclass(pkg.Schema, Validator)
except Exception as e:
raise ValueError(
(f"{self.schema_path.as_posix()} does not contain the required `class Schema(pa.SchemaModel)`")
Expand Down Expand Up @@ -99,9 +98,5 @@ def _check_schema_match_data(self) -> None:

try:
schema_module.Schema.validate(data, lazy=True)
except pa.errors.SchemaErrors as e:
raise ValueError("Validation of the schema against the data has failed:" "\n" f"{e.failure_cases}") from e
except Exception as e:
raise ValueError(
"Validation of the schema against the data has failed for unexpected reasons:" "\n" f"{e}"
) from e
raise ValueError("Validation of the schema against the data has failed:" "\n" f"{e}") from e
7 changes: 7 additions & 0 deletions src/dac/_input/interface.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from typing import Any, Protocol, runtime_checkable


@runtime_checkable
class Validator(Protocol):
def validate(self, check_obj: Any, *args, **kwargs) -> Any:
pass

0 comments on commit 7592336

Please sign in to comment.