Skip to content

Commit

Permalink
Merge pull request #13 from StreetEasy/bump-poetry
Browse files Browse the repository at this point in the history
renaming to dfschema
  • Loading branch information
Casyfill authored Oct 21, 2022
2 parents b166fc3 + b909aa9 commit 6eb15b4
Show file tree
Hide file tree
Showing 76 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Key features:
Via wrapper
```python
import pandas as pd
import dfs
import dfschema as dfs


df = pd.DataFrame({
Expand Down
Binary file removed dfs/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file removed dfs/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file removed dfs/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file removed dfs/__pycache__/categorical.cpython-39.pyc
Binary file not shown.
Binary file removed dfs/__pycache__/cli.cpython-37.pyc
Binary file not shown.
Binary file removed dfs/__pycache__/cli.cpython-38.pyc
Binary file not shown.
Binary file removed dfs/__pycache__/dtypes.cpython-39.pyc
Binary file not shown.
Binary file removed dfs/__pycache__/exceptions.cpython-39.pyc
Binary file not shown.
Binary file removed dfs/__pycache__/json_schema.cpython-37.pyc
Binary file not shown.
Binary file removed dfs/__pycache__/json_schema.cpython-39.pyc
Binary file not shown.
Binary file removed dfs/__pycache__/misc.cpython-39.pyc
Binary file not shown.
Binary file removed dfs/__pycache__/utils.cpython-37.pyc
Binary file not shown.
Binary file removed dfs/__pycache__/utils.cpython-38.pyc
Binary file not shown.
Binary file removed dfs/__pycache__/utils.cpython-39.pyc
Binary file not shown.
Binary file removed dfs/__pycache__/validate.cpython-37.pyc
Binary file not shown.
Binary file removed dfs/__pycache__/validate.cpython-38.pyc
Binary file not shown.
Binary file removed dfs/__pycache__/validate.cpython-39.pyc
Binary file not shown.
Binary file removed dfs/__pycache__/value_limits.cpython-39.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/collector.cpython-37.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/collector.cpython-38.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/column.cpython-37.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/column.cpython-38.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/column.cpython-39.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/core.cpython-37.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/core.cpython-38.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/core.cpython-39.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/dtype.cpython-37.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/dtype.cpython-38.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/dtype.cpython-39.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/exceptions.cpython-37.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/exceptions.cpython-38.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/exceptions.cpython-39.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/generate.cpython-37.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/generate.cpython-38.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/legacy.cpython-37.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/legacy.cpython-39.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/logger.cpython-37.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/logger.cpython-38.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/logger.cpython-39.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/misc.cpython-37.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/misc.cpython-38.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/misc.cpython-39.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/shape.cpython-37.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/shape.cpython-38.pyc
Binary file not shown.
Binary file removed dfs/core/__pycache__/shape.cpython-39.pyc
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logging
from dfs.core.legacy.v1 import V1_DfSchema
from dfschema.core.legacy.v1 import V1_DfSchema


LegacySchemaRegistry = {1.0: V1_DfSchema}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.poetry]
name = "dfs"
name = "dfschema"
version = "0.0.0" # set via gitlab-ci
description = "lightweight pandas.DataFrame schema"
authors = ["Philipp <[email protected]>"]
Expand Down
6 changes: 3 additions & 3 deletions tests/test_categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


def test_df_oneof():
from dfs import validate_df, DataFrameSummaryError
from dfschema import validate_df, DataFrameSummaryError

df = pd.DataFrame({"x": [1, 2, 3], "y": [0.2, 0.5, 0.99], "z": ["A", "A", "Q"]})
schema = {
Expand All @@ -28,7 +28,7 @@ def test_df_oneof():

# @given(df=cat_df_include())
def test_df_include():
from dfs import validate_df, DataFrameSummaryError
from dfschema import validate_df, DataFrameSummaryError

df = pd.DataFrame({"x": [1, 2, 3], "y": [0.2, 0.5, 0.99], "z": ["A", "Q", "Q"]})

Expand All @@ -49,7 +49,7 @@ def test_df_include():


def test_df_unique():
from dfs import validate_df, DataFrameSummaryError
from dfschema import validate_df, DataFrameSummaryError

df = pd.DataFrame({"x": [1, 2, 3], "y": [0.2, 0.5, 0.99], "z": ["A", "B", "C"]})
schema = {
Expand Down
6 changes: 3 additions & 3 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

@pytest.mark.parametrize("format", ["json", "yaml"])
def test_cli_generate(format):
from dfs.cli import app
from dfschema.cli import app
import json
import yaml

Expand All @@ -23,7 +23,7 @@ def test_cli_generate(format):


def test_cli_validate():
from dfs.cli import app
from dfschema.cli import app

result = runner.invoke(
app,
Expand All @@ -38,7 +38,7 @@ def test_cli_validate():


def test_cli_validate_error():
from dfs.cli import app
from dfschema.cli import app

result = runner.invoke(
app,
Expand Down
4 changes: 2 additions & 2 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@


def test_schema_objects(good_schema: dict):
from dfs.core.core import DfSchema
from dfschema.core.core import DfSchema

DfSchema.from_dict(good_schema["schema"])


def test_bad_schema_objects(bad_schema: dict):
from dfs.core.core import DfSchema
from dfschema.core.core import DfSchema

with pytest.raises((ValidationError, TypeError)):
DfSchema.from_dict(bad_schema["schema"])
2 changes: 1 addition & 1 deletion tests/test_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


def test_generate(df1):
from dfs.core import DfSchema
from dfschema.core import DfSchema

print(df1.dtypes)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_invalid.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


def test_df_validate_invalid_schema(df1, bad_schema: dict):
from dfs import validate_df
from dfschema import validate_df
from pydantic import ValidationError

with pytest.raises(ValidationError):
Expand Down
6 changes: 3 additions & 3 deletions tests/test_numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@

@pytest.mark.parametrize("schema", max_min_correct["df1"])
def test_validate_df1_max_min(df1, schema):
from dfs import validate_df
from dfschema import validate_df

validate_df(df1, schema)


@pytest.mark.parametrize("schema", max_min_correct["df2"])
def test_validate_df2_max_min(df2, schema):
from dfs import validate_df
from dfschema import validate_df

validate_df(df2, schema)

Expand All @@ -87,7 +87,7 @@ def test_validate_df2_max_min(df2, schema):

@pytest.mark.parametrize("schema", wrong_schemas_max_min_df2)
def test_validate_df2_max_min_raises(df2, schema):
from dfs import validate_df, DataFrameValidationError
from dfschema import validate_df, DataFrameValidationError

with pytest.raises(DataFrameValidationError):
validate_df(df2, schema)
6 changes: 3 additions & 3 deletions tests/test_str_patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def str_df() -> pd.DataFrame:


def test_string_matching(str_df):
from dfs.core.core import DfSchema
from dfschema.core.core import DfSchema

D = {
"metadata": {"protocol_version": 2.0},
Expand All @@ -30,8 +30,8 @@ def test_string_matching(str_df):


def test_string_matching_raises(str_df):
from dfs import DfSchema
from dfs.core.exceptions import DataFrameSummaryError
from dfschema import DfSchema
from dfschema.core.exceptions import DataFrameSummaryError

D = {
"metadata": {"protocol_version": 2.0},
Expand Down
8 changes: 4 additions & 4 deletions tests/test_subsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def df_subset():


def test_subset_dict(df_subset):
from dfs.core.core import DfSchema
from dfschema.core.core import DfSchema

D = {
"metadata": {"protocol_version": 2.0},
Expand All @@ -36,7 +36,7 @@ def test_subset_dict(df_subset):


def test_subset_query(df_subset):
from dfs.core.core import DfSchema
from dfschema.core.core import DfSchema

D = {
"metadata": {"protocol_version": 2.0},
Expand Down Expand Up @@ -64,8 +64,8 @@ def test_subset_query(df_subset):


def test_subset_query_raises(df_subset):
from dfs.core.core import DfSchema
from dfs.core.exceptions import DataFrameSummaryError
from dfschema.core.core import DfSchema
from dfschema.core.exceptions import DataFrameSummaryError

D = {
"metadata": {"protocol_version": 2.0},
Expand Down
4 changes: 2 additions & 2 deletions tests/test_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@


def test_validate_df_v1_invalid(bad_schema_v1):
from dfs.core.core import DfSchema
from dfschema.core.core import DfSchema

with pytest.raises((ValidationError, TypeError)):
DfSchema.from_dict(bad_schema_v1["schema"])


def test_schema_objects(good_schema_v1: dict):
from dfs.core.core import DfSchema
from dfschema.core.core import DfSchema

DfSchema.from_dict(good_schema_v1["schema"])
12 changes: 6 additions & 6 deletions tests/test_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

@pytest.mark.parametrize("schema", good_schemas)
def test_validate_df(df1, schema):
from dfs import validate_df
from dfschema import validate_df

validate_df(df1, schema)

Expand All @@ -52,7 +52,7 @@ def test_validate_df(df1, schema):
@pytest.mark.parametrize("summary", [False, True])
@pytest.mark.parametrize("schema", wrong_schemas)
def test_validate_df_raises(df1, summary, schema):
from dfs import (
from dfschema import (
validate_df,
DataFrameValidationError,
DataFrameSummaryError,
Expand Down Expand Up @@ -91,15 +91,15 @@ def test_validate_df_raises(df1, summary, schema):

@pytest.mark.parametrize("schema", good_schemas2)
def test_validate_df2(df2, schema):
from dfs import validate_df
from dfschema import validate_df

validate_df(df2, schema)


@pytest.mark.parametrize("summary", [False, True])
@pytest.mark.parametrize("schema", wrong_schemas2)
def test_validate_df2_raises(df2, summary, schema):
from dfs import (
from dfschema import (
validate_df,
DataFrameValidationError,
DataFrameSummaryError,
Expand Down Expand Up @@ -133,14 +133,14 @@ def test_validate_df2_raises(df2, summary, schema):

@pytest.mark.parametrize("schema", good_schemas3)
def test_validate_nan_str(df3, schema):
from dfs import validate_df
from dfschema import validate_df

validate_df(df3, schema)


@pytest.mark.parametrize("schema", wrong_schemas3)
def test_validate_df3_raises(df3, schema):
from dfs import validate_df, DataFrameValidationError
from dfschema import validate_df, DataFrameValidationError

with pytest.raises(DataFrameValidationError):
validate_df(df3, schema)

0 comments on commit 6eb15b4

Please sign in to comment.