Skip to content

Commit

Permalink
update default so omitted
Browse files Browse the repository at this point in the history
  • Loading branch information
rreinold committed Sep 19, 2024
1 parent 25cafd7 commit da396bc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 20 deletions.
2 changes: 1 addition & 1 deletion great_expectations/expectations/expectation.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def schema_extra(schema: Dict[str, Any], model: Type[Expectation]) -> None:
args_keys: ClassVar[Tuple[str, ...]] = ()

expectation_type: ClassVar[str]
windows: Optional[List[Window]] = pydantic.Field(default=[], description=WINDOWS_DESCRIPTION)
windows: Optional[List[Window]] = pydantic.Field(default=None, description=WINDOWS_DESCRIPTION)
examples: ClassVar[List[dict]] = []

_save_callback: Union[Callable[[Expectation], Expectation], None] = pydantic.PrivateAttr(
Expand Down
2 changes: 1 addition & 1 deletion tests/expectations/core/test_core_model_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_all_core_model_schemas_are_serializable():
model.schema_json()


@pytest.mark.filesystem
@pytest.mark.filesystem # ~4s
def test_schemas_updated():
all_models = {
cls_name: expectation
Expand Down
20 changes: 2 additions & 18 deletions tests/expectations/test_expectation.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from great_expectations.expectations.expectation_configuration import (
ExpectationConfiguration,
)
from great_expectations.expectations.window import Offset, Window
from great_expectations.validator.metric_configuration import MetricConfiguration

LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -227,32 +226,17 @@ def test_expectation_configuration_property():


@pytest.mark.unit
def test_expectation_configuration_window():
def test_expectation_configuration_window_empty():
expectation = gxe.ExpectColumnMaxToBeBetween(
column="foo",
min_value=0,
max_value=10,
windows=[
Window(
constraint_fn="a",
parameter_name="b",
range=5,
offset=Offset(positive=0.2, negative=0.2),
)
],
windows=None,
)

assert expectation.configuration == ExpectationConfiguration(
type="expect_column_max_to_be_between",
kwargs={
"windows": [
{
"constraint_fn": "a",
"parameter_name": "b",
"range": 5,
"offset": {"positive": 0.2, "negative": 0.2},
}
],
"column": "foo",
"min_value": 0,
"max_value": 10,
Expand Down

0 comments on commit da396bc

Please sign in to comment.