Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MAINTENANCE] Update import path for UnexpectedRowsExpectation #10234

Merged
merged 2 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

# <snippet name="docs/docusaurus/docs/snippets/unexpected_row_expectation.py define_custom_expectation">
class UnexpectedTripDistance(UnexpectedRowsExpectation):
unexpected_rows_query = """
unexpected_rows_query: str = """
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mypy doesn't understand this as a field without the type hint 🤷

SELECT
vendor_id, pickup_datetime
FROM
Expand Down
2 changes: 1 addition & 1 deletion great_expectations/expectations/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from great_expectations.expectations.expectation import Expectation
from great_expectations.expectations.expectation import Expectation, UnexpectedRowsExpectation

from .core import (
ExpectColumnDistinctValuesToBeInSet,
Expand Down
2 changes: 1 addition & 1 deletion great_expectations/expectations/expectation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1613,7 +1613,7 @@ def _validate_metric_value_between( # noqa: C901, PLR0912
return {"success": success, "result": {"observed_value": metric_value}}


class UnexpectedRowsExpectation(BatchExpectation, ABC):
class UnexpectedRowsExpectation(BatchExpectation):
"""
UnexpectedRowsExpectations facilitate the execution of SQL or Spark-SQL queries as the core logic for an Expectation.

Expand Down
2 changes: 1 addition & 1 deletion tests/expectations/test_expectation.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
from great_expectations.compatibility import pydantic
from great_expectations.data_context.util import file_relative_path
from great_expectations.exceptions import InvalidExpectationConfigurationError
from great_expectations.expectations import UnexpectedRowsExpectation
from great_expectations.expectations.expectation import (
ColumnMapExpectation,
ColumnPairMapExpectation,
MulticolumnMapExpectation,
UnexpectedRowsExpectation,
_validate_dependencies_against_available_metrics,
)
from great_expectations.expectations.expectation_configuration import (
Expand Down
Loading