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

[DOCS] fix custom SQL Expectation approach for cloud #10844

Open
wants to merge 21 commits into
base: develop
Choose a base branch
from

Conversation

klavavej
Copy link
Contributor

Resolves https://greatexpectations.atlassian.net/browse/DOC-941

  • Description of PR changes above includes a link to an existing GitHub issue
  • PR title is prefixed with one of: [BUGFIX], [FEATURE], [DOCS], [MAINTENANCE], [CONTRIB]
  • Code is linted - run invoke lint (uses ruff format + ruff check)
  • Appropriate tests and docs have been updated

@netlify /docs/core/customize_expectations/use_sql_to_define_a_custom_expectation/

For more information about contributing, visit our community resources.

After you submit your PR, keep the page open and monitor the statuses of the various checks made by our continuous integration process at the bottom of the page. Please fix any issues that come up and reach out on Slack if you need help. Thanks for contributing!

Copy link

netlify bot commented Jan 10, 2025

Deploy Preview for niobium-lead-7998 ready!

Name Link
🔨 Latest commit 133262a
🔍 Latest deploy log https://app.netlify.com/sites/niobium-lead-7998/deploys/67818aed8dab510008457810
😎 Deploy Preview https://deploy-preview-10844.docs.greatexpectations.io/docs/core/customize_expectations/use_sql_to_define_a_custom_expectation/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 10, 2025

Deploy Preview for niobium-lead-7998 ready!

Name Link
🔨 Latest commit
🔍 Latest deploy log https://app.netlify.com/sites/niobium-lead-7998/deploys/678548d784cb6f4a5f6c55ce
😎 Deploy Preview https://deploy-preview-10844.docs.greatexpectations.io/docs/core/customize_expectations/use_sql_to_define_a_custom_expectation/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Jan 10, 2025

❌ 5 Tests Failed:

Tests completed Failed Passed Skipped
21226 5 21221 5858
View the top 3 failed tests by shortest run time
tests.integration.cloud.end_to_end.test_pandas_filesystem_datasource::test_checkpoint_run[parquet_batch_definition]
Stack Traces | 5.99s run time
+ Exception Group Traceback (most recent call last):
  |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9................../site-packages/_pytest/runner.py", line 341, in from_call
  |     result: TResult | None = func()
  |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.../site-packages/flaky/flaky_pytest_plugin.py", line 146, in <lambda>
  |     lambda: ihook(item=item, **kwds), when=when, reraise=reraise
  |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.../site-packages/pluggy/_hooks.py", line 513, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.../site-packages/pluggy/_manager.py", line 120, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9................../site-packages/pluggy/_callers.py", line 139, in _multicall
  |     raise exception.with_traceback(exception.__traceback__)
  |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9................../site-packages/pluggy/_callers.py", line 122, in _multicall
  |     teardown.throw(exception)  # type: ignore[union-attr]
  |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9....../site-packages/_pytest/threadexception.py", line 97, in pytest_runtest_teardown
  |     yield from thread_exception_runtest_hook()
  |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9....../site-packages/_pytest/threadexception.py", line 68, in thread_exception_runtest_hook
  |     yield
  |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9................../site-packages/pluggy/_callers.py", line 122, in _multicall
  |     teardown.throw(exception)  # type: ignore[union-attr]
  |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9....../site-packages/_pytest/unraisableexception.py", line 100, in pytest_runtest_teardown
  |     yield from unraisable_exception_runtest_hook()
  |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9....../site-packages/_pytest/unraisableexception.py", line 70, in unraisable_exception_runtest_hook
  |     yield
  |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9................../site-packages/pluggy/_callers.py", line 122, in _multicall
  |     teardown.throw(exception)  # type: ignore[union-attr]
  |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9....../site-packages/_pytest/logging.py", line 853, in pytest_runtest_teardown
  |     yield from self._runtest_for(item, "teardown")
  |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9....../site-packages/_pytest/logging.py", line 829, in _runtest_for
  |     yield
  |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9................../site-packages/pluggy/_callers.py", line 122, in _multicall
  |     teardown.throw(exception)  # type: ignore[union-attr]
  |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.../site-packages/_pytest/capture.py", line 885, in pytest_runtest_teardown
  |     return (yield)
  |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9................../site-packages/pluggy/_callers.py", line 103, in _multicall
  |     res = hook_impl.function(*args)
  |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9................../site-packages/_pytest/runner.py", line 189, in pytest_runtest_teardown
  |     item.session._setupstate.teardown_exact(nextitem)
  |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9................../site-packages/_pytest/runner.py", line 557, in teardown_exact
  |     raise exceptions[0]
  | exceptiongroup.ExceptionGroup: errors while tearing down <Module test_pandas_filesystem_datasource.py> (3 sub-exceptions)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9................../site-packages/_pytest/runner.py", line 546, in teardown_exact
    |     fin()
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.........................../site-packages/_pytest/fixtures.py", line 1032, in finish
    |     raise exceptions[0]
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.........................../site-packages/_pytest/fixtures.py", line 1021, in finish
    |     fin()
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.........................../site-packages/_pytest/fixtures.py", line 907, in _teardown_yield_fixture
    |     next(it)
    |   File ".../cloud/end_to_end/conftest.py", line 101, in checkpoint
    |     context.checkpoints.delete(name=checkpoint_name)
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.../core/factory/checkpoint_factory.py", line 88, in delete
    |     checkpoint = self.get(name=name)
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.../core/factory/checkpoint_factory.py", line 118, in get
    |     return self._get(key=key)
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.../core/factory/checkpoint_factory.py", line 127, in _get
    |     checkpoint = self._store.get(key=key)
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.../data_context/store/store.py", line 246, in get
    |     return self.deserialize(value)
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.../data_context/store/checkpoint_store.py", line 94, in deserialize
    |     return Checkpoint.parse_obj(value)
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.../pydantic/v1/main.py", line 526, in parse_obj
    |     return cls(**obj)
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.../pydantic/v1/main.py", line 341, in __init__
    |     raise validation_error
    | pydantic.v1.error_wrappers.ValidationError: 1 validation error for Checkpoint
    | validation_definitions -> data
    |   Could not find datasource named 'ds_b665867273724a78bcf1c056dec0050a'. (type=value_error)
    +---------------- 2 ----------------
    | Traceback (most recent call last):
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.../data_context/store/gx_cloud_store_backend.py", line 504, in remove_key
    |     response.raise_for_status()
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9....../site-packages/requests/models.py", line 1024, in raise_for_status
    |     raise HTTPError(http_error_msg, response=self)
    | requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http://localhost:.../0ccac18e-7631-4bdd-8a42-3c35cce574c6/expectation-suites/35fc4fb0-59b9-48d8-a303-260c7e95351c
    | 
    | The above exception was the direct cause of the following exception:
    | 
    | Traceback (most recent call last):
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9................../site-packages/_pytest/runner.py", line 546, in teardown_exact
    |     fin()
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.........................../site-packages/_pytest/fixtures.py", line 1032, in finish
    |     raise exceptions[0]
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.........................../site-packages/_pytest/fixtures.py", line 1021, in finish
    |     fin()
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.........................../site-packages/_pytest/fixtures.py", line 907, in _teardown_yield_fixture
    |     next(it)
    |   File ".../cloud/end_to_end/conftest.py", line 85, in expectation_suite
    |     context.suites.delete(expectation_suite_name)
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.../core/factory/suite_factory.py", line 83, in delete
    |     self._store.remove_key(key=key)
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.../data_context/store/store.py", line 347, in remove_key
    |     return self.store_backend.remove_key(key)
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.../data_context/store/gx_cloud_store_backend.py", line 518, in remove_key
    |     raise StoreBackendError(  # noqa: TRY003 # FIXME CoP
    | great_expectations.exceptions.exceptions.StoreBackendError: Unable to delete object in GX Cloud Store Backend: [{"detail": "Expectation Suite is used by Checkpoint 8e69ce9a-8d2e-4dac-9dab-f4e5a5119cc7", "code": "used"}, {"detail": "Expectation Suite is used by Validation Definition `val_def_73bdc06e301d45169504f17672d87cee` with ID 27cbd5a4-4a93-4849-8546-a26db20ce367.", "code": "used"}]
    +---------------- 3 ----------------
    | Traceback (most recent call last):
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.../data_context/store/gx_cloud_store_backend.py", line 504, in remove_key
    |     response.raise_for_status()
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9....../site-packages/requests/models.py", line 1024, in raise_for_status
    |     raise HTTPError(http_error_msg, response=self)
    | requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http://localhost:.../0ccac18e-7631-4bdd-8a42-3c35cce574c6/data-assets/a0d4914b-4593-4a2d-b4c5-97ff59cb6281
    | 
    | The above exception was the direct cause of the following exception:
    | 
    | Traceback (most recent call last):
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9................../site-packages/_pytest/runner.py", line 546, in teardown_exact
    |     fin()
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.........................../site-packages/_pytest/fixtures.py", line 1032, in finish
    |     raise exceptions[0]
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.........................../site-packages/_pytest/fixtures.py", line 1021, in finish
    |     fin()
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.........................../site-packages/_pytest/fixtures.py", line 907, in _teardown_yield_fixture
    |     next(it)
    |   File ".../cloud/end_to_end/test_pandas_filesystem_datasource.py", line 99, in csv_asset
    |     datasource.delete_asset(name=asset_name)
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.../datasource/fluent/interfaces.py", line 850, in delete_asset
    |     self._data_context._delete_asset(id=str(asset.id))
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.../data_context/data_context/cloud_data_context.py", line 498, in _delete_asset
    |     return self._data_asset_store.remove_key(key)
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.../data_context/store/data_asset_store.py", line 81, in remove_key
    |     return self._store_backend.remove_key(key.to_tuple())
    |   File ".../hostedtoolcache/Python/3.9.21.................................................................................................................................................../x64/lib/python3.9.../data_context/store/gx_cloud_store_backend.py", line 518, in remove_key
    |     raise StoreBackendError(  # noqa: TRY003 # FIXME CoP
    | great_expectations.exceptions.exceptions.StoreBackendError: Unable to delete object in GX Cloud Store Backend: [{"detail": "Datasource is used by Validation 27cbd5a4-4a93-4849-8546-a26db20ce367", "code": "used"}]
    +------------------------------------
tests.integration.cloud.end_to_end.test_pandas_datasource::test_checkpoint_run
Stack Traces | 28.4s run time
+ Exception Group Traceback (most recent call last):
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9...................../site-packages/_pytest/runner.py", line 341, in from_call
  |     result: TResult | None = func()
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../site-packages/flaky/flaky_pytest_plugin.py", line 146, in <lambda>
  |     lambda: ihook(item=item, **kwds), when=when, reraise=reraise
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../site-packages/pluggy/_hooks.py", line 513, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../site-packages/pluggy/_manager.py", line 120, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9................../site-packages/pluggy/_callers.py", line 139, in _multicall
  |     raise exception.with_traceback(exception.__traceback__)
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9................../site-packages/pluggy/_callers.py", line 122, in _multicall
  |     teardown.throw(exception)  # type: ignore[union-attr]
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9....../site-packages/_pytest/threadexception.py", line 97, in pytest_runtest_teardown
  |     yield from thread_exception_runtest_hook()
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9....../site-packages/_pytest/threadexception.py", line 68, in thread_exception_runtest_hook
  |     yield
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9................../site-packages/pluggy/_callers.py", line 122, in _multicall
  |     teardown.throw(exception)  # type: ignore[union-attr]
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9....../site-packages/_pytest/unraisableexception.py", line 100, in pytest_runtest_teardown
  |     yield from unraisable_exception_runtest_hook()
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9....../site-packages/_pytest/unraisableexception.py", line 70, in unraisable_exception_runtest_hook
  |     yield
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9................../site-packages/pluggy/_callers.py", line 122, in _multicall
  |     teardown.throw(exception)  # type: ignore[union-attr]
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9....../site-packages/_pytest/logging.py", line 853, in pytest_runtest_teardown
  |     yield from self._runtest_for(item, "teardown")
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9....../site-packages/_pytest/logging.py", line 829, in _runtest_for
  |     yield
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9................../site-packages/pluggy/_callers.py", line 122, in _multicall
  |     teardown.throw(exception)  # type: ignore[union-attr]
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../site-packages/_pytest/capture.py", line 885, in pytest_runtest_teardown
  |     return (yield)
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9................../site-packages/pluggy/_callers.py", line 103, in _multicall
  |     res = hook_impl.function(*args)
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9...................../site-packages/_pytest/runner.py", line 189, in pytest_runtest_teardown
  |     item.session._setupstate.teardown_exact(nextitem)
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9...................../site-packages/_pytest/runner.py", line 557, in teardown_exact
  |     raise exceptions[0]
  | exceptiongroup.ExceptionGroup: errors while tearing down <Module test_pandas_datasource.py> (4 sub-exceptions)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9...................../site-packages/_pytest/runner.py", line 546, in teardown_exact
    |     fin()
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9..................................../site-packages/_pytest/fixtures.py", line 1032, in finish
    |     raise exceptions[0]
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9..................................../site-packages/_pytest/fixtures.py", line 1021, in finish
    |     fin()
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9..................................../site-packages/_pytest/fixtures.py", line 907, in _teardown_yield_fixture
    |     next(it)
    |   File ".../cloud/end_to_end/conftest.py", line 101, in checkpoint
    |     context.checkpoints.delete(name=checkpoint_name)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../core/factory/checkpoint_factory.py", line 88, in delete
    |     checkpoint = self.get(name=name)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../core/factory/checkpoint_factory.py", line 118, in get
    |     return self._get(key=key)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../core/factory/checkpoint_factory.py", line 127, in _get
    |     checkpoint = self._store.get(key=key)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../data_context/store/store.py", line 246, in get
    |     return self.deserialize(value)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../data_context/store/checkpoint_store.py", line 94, in deserialize
    |     return Checkpoint.parse_obj(value)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../pydantic/v1/main.py", line 526, in parse_obj
    |     return cls(**obj)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../pydantic/v1/main.py", line 341, in __init__
    |     raise validation_error
    | pydantic.v1.error_wrappers.ValidationError: 1 validation error for Checkpoint
    | validation_definitions -> data
    |   Could not find datasource named 'ds_022b312b96d04c3fa0769d1f5fce74c0'. (type=value_error)
    +---------------- 2 ----------------
    | Traceback (most recent call last):
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../data_context/store/gx_cloud_store_backend.py", line 504, in remove_key
    |     response.raise_for_status()
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9........./site-packages/requests/models.py", line 1024, in raise_for_status
    |     raise HTTPError(http_error_msg, response=self)
    | requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http://localhost:.../0ccac18e-7631-4bdd-8a42-3c35cce574c6/expectation-suites/462f6eb9-815d-4476-9efd-e010f323a6d7
    | 
    | The above exception was the direct cause of the following exception:
    | 
    | Traceback (most recent call last):
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9...................../site-packages/_pytest/runner.py", line 546, in teardown_exact
    |     fin()
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9..................................../site-packages/_pytest/fixtures.py", line 1032, in finish
    |     raise exceptions[0]
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9..................................../site-packages/_pytest/fixtures.py", line 1021, in finish
    |     fin()
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9..................................../site-packages/_pytest/fixtures.py", line 907, in _teardown_yield_fixture
    |     next(it)
    |   File ".../cloud/end_to_end/conftest.py", line 85, in expectation_suite
    |     context.suites.delete(expectation_suite_name)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../core/factory/suite_factory.py", line 83, in delete
    |     self._store.remove_key(key=key)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../data_context/store/store.py", line 347, in remove_key
    |     return self.store_backend.remove_key(key)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../data_context/store/gx_cloud_store_backend.py", line 518, in remove_key
    |     raise StoreBackendError(  # noqa: TRY003 # FIXME CoP
    | great_expectations.exceptions.exceptions.StoreBackendError: Unable to delete object in GX Cloud Store Backend: [{"detail": "Expectation Suite is used by Checkpoint 25ec2150-b928-43f6-94e4-e80dc147bc09", "code": "used"}, {"detail": "Expectation Suite is used by Validation Definition `val_def_a03a567e4bdf4e69a19f0112ef32d02b` with ID 0aa2f3fd-1006-4300-b3af-9e8fe70b5057.", "code": "used"}]
    +---------------- 3 ----------------
    | Traceback (most recent call last):
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../data_context/store/gx_cloud_store_backend.py", line 504, in remove_key
    |     response.raise_for_status()
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9........./site-packages/requests/models.py", line 1024, in raise_for_status
    |     raise HTTPError(http_error_msg, response=self)
    | requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http://localhost:.../0ccac18e-7631-4bdd-8a42-3c35cce574c6/data-assets/12c45864-6860-47b1-be5f-1503f29f4759
    | 
    | The above exception was the direct cause of the following exception:
    | 
    | Traceback (most recent call last):
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9...................../site-packages/_pytest/runner.py", line 546, in teardown_exact
    |     fin()
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9..................................../site-packages/_pytest/fixtures.py", line 1032, in finish
    |     raise exceptions[0]
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9..................................../site-packages/_pytest/fixtures.py", line 1021, in finish
    |     fin()
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9..................................../site-packages/_pytest/fixtures.py", line 907, in _teardown_yield_fixture
    |     next(it)
    |   File ".../cloud/end_to_end/test_pandas_datasource.py", line 60, in data_asset
    |     datasource.delete_asset(name=asset_name)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../datasource/fluent/interfaces.py", line 850, in delete_asset
    |     self._data_context._delete_asset(id=str(asset.id))
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../data_context/data_context/cloud_data_context.py", line 498, in _delete_asset
    |     return self._data_asset_store.remove_key(key)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../data_context/store/data_asset_store.py", line 81, in remove_key
    |     return self._store_backend.remove_key(key.to_tuple())
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../data_context/store/gx_cloud_store_backend.py", line 518, in remove_key
    |     raise StoreBackendError(  # noqa: TRY003 # FIXME CoP
    | great_expectations.exceptions.exceptions.StoreBackendError: Unable to delete object in GX Cloud Store Backend: [{"detail": "Datasource is used by Validation 0aa2f3fd-1006-4300-b3af-9e8fe70b5057", "code": "used"}]
    +---------------- 4 ----------------
    | Traceback (most recent call last):
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../data_context/store/gx_cloud_store_backend.py", line 504, in remove_key
    |     response.raise_for_status()
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9........./site-packages/requests/models.py", line 1024, in raise_for_status
    |     raise HTTPError(http_error_msg, response=self)
    | requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http://localhost:.../0ccac18e-7631-4bdd-8a42-3c35cce574c6/validation-definitions/0aa2f3fd-1006-4300-b3af-9e8fe70b5057
    | 
    | The above exception was the direct cause of the following exception:
    | 
    | Traceback (most recent call last):
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9...................../site-packages/_pytest/runner.py", line 546, in teardown_exact
    |     fin()
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9..................................../site-packages/_pytest/fixtures.py", line 1032, in finish
    |     raise exceptions[0]
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9..................................../site-packages/_pytest/fixtures.py", line 1021, in finish
    |     fin()
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9..................................../site-packages/_pytest/fixtures.py", line 907, in _teardown_yield_fixture
    |     next(it)
    |   File ".../cloud/end_to_end/test_pandas_datasource.py", line 90, in validation_definition
    |     context.validation_definitions.delete(name=validation_def_name)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../core/factory/validation_definition_factory.py", line 77, in delete
    |     self._store.remove_key(key=key)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../data_context/store/store.py", line 347, in remove_key
    |     return self.store_backend.remove_key(key)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../data_context/store/gx_cloud_store_backend.py", line 518, in remove_key
    |     raise StoreBackendError(  # noqa: TRY003 # FIXME CoP
    | great_expectations.exceptions.exceptions.StoreBackendError: Unable to delete object in GX Cloud Store Backend: Please contact the Great Expectations team at support@greatexpectations.io
    +------------------------------------
tests.integration.cloud.end_to_end.test_spark_filesystem_datasource::test_checkpoint_run
Stack Traces | 30.5s run time
+ Exception Group Traceback (most recent call last):
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9...................../site-packages/_pytest/runner.py", line 341, in from_call
  |     result: TResult | None = func()
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../site-packages/flaky/flaky_pytest_plugin.py", line 146, in <lambda>
  |     lambda: ihook(item=item, **kwds), when=when, reraise=reraise
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../site-packages/pluggy/_hooks.py", line 513, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../site-packages/pluggy/_manager.py", line 120, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9................../site-packages/pluggy/_callers.py", line 139, in _multicall
  |     raise exception.with_traceback(exception.__traceback__)
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9................../site-packages/pluggy/_callers.py", line 122, in _multicall
  |     teardown.throw(exception)  # type: ignore[union-attr]
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9....../site-packages/_pytest/threadexception.py", line 97, in pytest_runtest_teardown
  |     yield from thread_exception_runtest_hook()
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9....../site-packages/_pytest/threadexception.py", line 68, in thread_exception_runtest_hook
  |     yield
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9................../site-packages/pluggy/_callers.py", line 122, in _multicall
  |     teardown.throw(exception)  # type: ignore[union-attr]
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9....../site-packages/_pytest/unraisableexception.py", line 100, in pytest_runtest_teardown
  |     yield from unraisable_exception_runtest_hook()
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9....../site-packages/_pytest/unraisableexception.py", line 70, in unraisable_exception_runtest_hook
  |     yield
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9................../site-packages/pluggy/_callers.py", line 122, in _multicall
  |     teardown.throw(exception)  # type: ignore[union-attr]
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9....../site-packages/_pytest/logging.py", line 853, in pytest_runtest_teardown
  |     yield from self._runtest_for(item, "teardown")
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9....../site-packages/_pytest/logging.py", line 829, in _runtest_for
  |     yield
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9................../site-packages/pluggy/_callers.py", line 122, in _multicall
  |     teardown.throw(exception)  # type: ignore[union-attr]
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../site-packages/_pytest/capture.py", line 885, in pytest_runtest_teardown
  |     return (yield)
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9................../site-packages/pluggy/_callers.py", line 103, in _multicall
  |     res = hook_impl.function(*args)
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9...................../site-packages/_pytest/runner.py", line 189, in pytest_runtest_teardown
  |     item.session._setupstate.teardown_exact(nextitem)
  |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9...................../site-packages/_pytest/runner.py", line 557, in teardown_exact
  |     raise exceptions[0]
  | exceptiongroup.ExceptionGroup: errors while tearing down <Module test_spark_filesystem_datasource.py> (4 sub-exceptions)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9...................../site-packages/_pytest/runner.py", line 546, in teardown_exact
    |     fin()
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9..................................../site-packages/_pytest/fixtures.py", line 1032, in finish
    |     raise exceptions[0]
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9..................................../site-packages/_pytest/fixtures.py", line 1021, in finish
    |     fin()
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9..................................../site-packages/_pytest/fixtures.py", line 907, in _teardown_yield_fixture
    |     next(it)
    |   File ".../cloud/end_to_end/conftest.py", line 101, in checkpoint
    |     context.checkpoints.delete(name=checkpoint_name)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../core/factory/checkpoint_factory.py", line 88, in delete
    |     checkpoint = self.get(name=name)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../core/factory/checkpoint_factory.py", line 118, in get
    |     return self._get(key=key)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../core/factory/checkpoint_factory.py", line 127, in _get
    |     checkpoint = self._store.get(key=key)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../data_context/store/store.py", line 246, in get
    |     return self.deserialize(value)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../data_context/store/checkpoint_store.py", line 94, in deserialize
    |     return Checkpoint.parse_obj(value)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../pydantic/v1/main.py", line 526, in parse_obj
    |     return cls(**obj)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../pydantic/v1/main.py", line 341, in __init__
    |     raise validation_error
    | pydantic.v1.error_wrappers.ValidationError: 1 validation error for Checkpoint
    | validation_definitions -> data
    |   Could not find datasource named 'ds_8e4beaf5f5b84b48bc6d3544bbd37a5e'. (type=value_error)
    +---------------- 2 ----------------
    | Traceback (most recent call last):
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../data_context/store/gx_cloud_store_backend.py", line 504, in remove_key
    |     response.raise_for_status()
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9........./site-packages/requests/models.py", line 1024, in raise_for_status
    |     raise HTTPError(http_error_msg, response=self)
    | requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http://localhost:.../0ccac18e-7631-4bdd-8a42-3c35cce574c6/expectation-suites/b1b26a97-83ae-4800-8be7-232f41eed490
    | 
    | The above exception was the direct cause of the following exception:
    | 
    | Traceback (most recent call last):
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9...................../site-packages/_pytest/runner.py", line 546, in teardown_exact
    |     fin()
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9..................................../site-packages/_pytest/fixtures.py", line 1032, in finish
    |     raise exceptions[0]
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9..................................../site-packages/_pytest/fixtures.py", line 1021, in finish
    |     fin()
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9..................................../site-packages/_pytest/fixtures.py", line 907, in _teardown_yield_fixture
    |     next(it)
    |   File ".../cloud/end_to_end/conftest.py", line 85, in expectation_suite
    |     context.suites.delete(expectation_suite_name)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../core/factory/suite_factory.py", line 83, in delete
    |     self._store.remove_key(key=key)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../data_context/store/store.py", line 347, in remove_key
    |     return self.store_backend.remove_key(key)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../data_context/store/gx_cloud_store_backend.py", line 518, in remove_key
    |     raise StoreBackendError(  # noqa: TRY003 # FIXME CoP
    | great_expectations.exceptions.exceptions.StoreBackendError: Unable to delete object in GX Cloud Store Backend: [{"detail": "Expectation Suite is used by Checkpoint 97702131-8e2d-464c-b075-2a4b16ab069a", "code": "used"}, {"detail": "Expectation Suite is used by Validation Definition `val_def_e5d94392c5ac4119bdaa455b2f105cb3` with ID 2c877391-626e-4106-9e8f-f1e3ed4cda61.", "code": "used"}]
    +---------------- 3 ----------------
    | Traceback (most recent call last):
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../data_context/store/gx_cloud_store_backend.py", line 504, in remove_key
    |     response.raise_for_status()
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9........./site-packages/requests/models.py", line 1024, in raise_for_status
    |     raise HTTPError(http_error_msg, response=self)
    | requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http://localhost:.../0ccac18e-7631-4bdd-8a42-3c35cce574c6/data-assets/16cfdf89-bc98-467d-b832-4e370e5c9520
    | 
    | The above exception was the direct cause of the following exception:
    | 
    | Traceback (most recent call last):
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9...................../site-packages/_pytest/runner.py", line 546, in teardown_exact
    |     fin()
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9..................................../site-packages/_pytest/fixtures.py", line 1032, in finish
    |     raise exceptions[0]
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9..................................../site-packages/_pytest/fixtures.py", line 1021, in finish
    |     fin()
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9..................................../site-packages/_pytest/fixtures.py", line 907, in _teardown_yield_fixture
    |     next(it)
    |   File ".../cloud/end_to_end/test_spark_filesystem_datasource.py", line 85, in csv_asset
    |     datasource.delete_asset(name=asset_name)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../datasource/fluent/interfaces.py", line 850, in delete_asset
    |     self._data_context._delete_asset(id=str(asset.id))
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../data_context/data_context/cloud_data_context.py", line 498, in _delete_asset
    |     return self._data_asset_store.remove_key(key)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../data_context/store/data_asset_store.py", line 81, in remove_key
    |     return self._store_backend.remove_key(key.to_tuple())
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../data_context/store/gx_cloud_store_backend.py", line 518, in remove_key
    |     raise StoreBackendError(  # noqa: TRY003 # FIXME CoP
    | great_expectations.exceptions.exceptions.StoreBackendError: Unable to delete object in GX Cloud Store Backend: [{"detail": "Datasource is used by Validation 2c877391-626e-4106-9e8f-f1e3ed4cda61", "code": "used"}]
    +---------------- 4 ----------------
    | Traceback (most recent call last):
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../data_context/store/gx_cloud_store_backend.py", line 504, in remove_key
    |     response.raise_for_status()
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9........./site-packages/requests/models.py", line 1024, in raise_for_status
    |     raise HTTPError(http_error_msg, response=self)
    | requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http://localhost:.../0ccac18e-7631-4bdd-8a42-3c35cce574c6/validation-definitions/2c877391-626e-4106-9e8f-f1e3ed4cda61
    | 
    | The above exception was the direct cause of the following exception:
    | 
    | Traceback (most recent call last):
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9...................../site-packages/_pytest/runner.py", line 546, in teardown_exact
    |     fin()
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9..................................../site-packages/_pytest/fixtures.py", line 1032, in finish
    |     raise exceptions[0]
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9..................................../site-packages/_pytest/fixtures.py", line 1021, in finish
    |     fin()
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9..................................../site-packages/_pytest/fixtures.py", line 907, in _teardown_yield_fixture
    |     next(it)
    |   File ".../cloud/end_to_end/test_spark_filesystem_datasource.py", line 113, in validation_definition
    |     context.validation_definitions.delete(name=validation_def_name)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../core/factory/validation_definition_factory.py", line 77, in delete
    |     self._store.remove_key(key=key)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../data_context/store/store.py", line 347, in remove_key
    |     return self.store_backend.remove_key(key)
    |   File ".../hostedtoolcache/Python/3.9.21............................................................................................................................................................................../x64/lib/python3.9.../data_context/store/gx_cloud_store_backend.py", line 518, in remove_key
    |     raise StoreBackendError(  # noqa: TRY003 # FIXME CoP
    | great_expectations.exceptions.exceptions.StoreBackendError: Unable to delete object in GX Cloud Store Backend: Please contact the Great Expectations team at support@greatexpectations.io
    +------------------------------------

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

@klavavej klavavej marked this pull request as ready for review January 10, 2025 23:10
```

2. Override the Expectation's `unexpected_rows_query` attribute.
1. Determine your custom SQL query.
Copy link
Contributor Author

@klavavej klavavej Jan 10, 2025

Choose a reason for hiding this comment

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

note for reviewers: I re-flowed the instructions to be more like the create an Expectation page where you determine parameters and then create an Expectation using them because the snippets were ending in awkward places when I tried to keep the old flow while switching from subclassing to using the class directly. Example of one iteration I didn't like:

old flow

Comment on lines 57 to 59
ExpectPassengerCountToBeLegal = gx.expectations.UnexpectedRowsExpectation(
unexpected_rows_query=my_query, description=my_description
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note for reviewers: I wanted the parameters to be on separate lines, but a CI automation keeps shoving them into one combined line. Is there any way I can preserve the line break?

ExpectPassengerCountToBeLegal = gx.expectations.UnexpectedRowsExpectation(
    unexpected_rows_query = my_query,
    description = my_description
)

Copy link
Contributor

Choose a reason for hiding this comment

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

In this case, you can just throw a trailing comma after my_description. AFAIK ruff format uses black, which is pretty opinionated, and that's one of its demands.

In other cases, if you really need an escape hatch, you can tell the formatter to skip a section with a # fmt: off and then a # fmt: on where it should start again. Looks like we only use that in one other place in this repo; I'd be extremely judicious in using this. The philosophy is pretty much to just go with what the formatter says, even if you don't love it.

Copy link
Contributor

@tyler-hoffman tyler-hoffman left a comment

Choose a reason for hiding this comment

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

Looks great! Left one small blocker on naming conventions!

Comment on lines 57 to 59
ExpectPassengerCountToBeLegal = gx.expectations.UnexpectedRowsExpectation(
unexpected_rows_query=my_query, description=my_description
)
Copy link
Contributor

Choose a reason for hiding this comment

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

In this case, you can just throw a trailing comma after my_description. AFAIK ruff format uses black, which is pretty opinionated, and that's one of its demands.

In other cases, if you really need an escape hatch, you can tell the formatter to skip a section with a # fmt: off and then a # fmt: on where it should start again. Looks like we only use that in one other place in this repo; I'd be extremely judicious in using this. The philosophy is pretty much to just go with what the formatter says, even if you don't love it.


# Customize how the Expectation renders in Data Docs.
# <snippet name="docs/docusaurus/docs/core/customize_expectations/_examples/use_sql_to_define_a_custom_expectation.py - define description">
my_description = "There should be no more than **6** passengers."
Copy link
Contributor

Choose a reason for hiding this comment

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

Please don't take action on this now, but just throwing it out as a stylistic thing in case other folks feel similarly - I personally find it much more to take in when we spread out simple stuff across multiple snippets, i.e., I'd rather just see this inlined when creating the expectation. But again, that's just my 2 cents!


# Create an Expectation using the UnexpectedRowsExpectation class and your parameters.
# <snippet name="docs/docusaurus/docs/core/customize_expectations/_examples/use_sql_to_define_a_custom_expectation.py - create Expectation">
ExpectPassengerCountToBeLegal = gx.expectations.UnexpectedRowsExpectation(
Copy link
Contributor

Choose a reason for hiding this comment

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

This is so small, but I'm going to throw a blocker on it. ExpectPassengerCountToBeLegal follows the class-naming convention. This should be expect_passenger_count_to_be_legal or something like that in snake_case

Copy link
Contributor

@tyler-hoffman tyler-hoffman left a comment

Choose a reason for hiding this comment

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

Thanks!

@klavavej klavavej added this pull request to the merge queue Jan 13, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 13, 2025
@klavavej klavavej added this pull request to the merge queue Jan 14, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 14, 2025
@klavavej klavavej added this pull request to the merge queue Jan 14, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 14, 2025
@klavavej klavavej added this pull request to the merge queue Jan 14, 2025
github-merge-queue bot pushed a commit that referenced this pull request Jan 14, 2025
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 14, 2025
@klavavej klavavej added this pull request to the merge queue Jan 14, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 14, 2025
@klavavej klavavej added this pull request to the merge queue Jan 14, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 14, 2025
@klavavej klavavej added this pull request to the merge queue Jan 14, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants