great-expectations / great_expectations

Always know what to expect from your data.
https://docs.greatexpectations.io/
Apache License 2.0
10k stars 1.55k forks source link

Arbitrary change #10677

Closed tyler-hoffman closed 3 days ago

tyler-hoffman commented 4 days ago

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!

netlify[bot] commented 4 days ago

Deploy Preview for niobium-lead-7998 canceled.

Name Link
Latest commit 23facce5e1f0c2c4a25897b1859dcca84ff1fff8
Latest deploy log https://app.netlify.com/sites/niobium-lead-7998/deploys/673a649b3ca69900081bfab9
codecov[bot] commented 4 days ago

:x: 7 Tests Failed:

Tests completed Failed Passed Skipped
27160 7 27153 4788
View the top 3 failed tests by shortest run time > > ```python > tests.datasource.fluent.test_pandas_datasource::test_cloud_get_csv_asset_not_in_memory > ``` > >
Stack Traces | 1.75s run time > > > > > ```python > > self = > > id = '758a6903-de5b-415f-a003-a5e921931eb3' > > value = {'assets': [{'filepath_or_buffer': '.../tests/test_sets/taxi_yello..., 'type': 'csv'}], 'id': '758a6903-de5b-415f-a003-a5e921931eb3', 'name': 'default_pandas_datasource', 'type': 'pandas'} > > > > def _put(self, id: str, value: Any) -> GXCloudResourceRef | bool: > > # This wonky signature is a sign that our abstractions are not helping us. > > # The cloud backend returns a bool for some resources, and the updated > > # resource for others. Since we route all update calls through this single > > # method, we need to handle both cases. > > > > resource_type = self.ge_cloud_resource_type > > organization_id = self.ge_cloud_credentials["organization_id"] > > attributes_key = self.PAYLOAD_ATTRIBUTES_KEYS[resource_type] > > > > data = self.construct_versioned_payload( > > resource_type=resource_type.value, > > attributes_key=attributes_key, > > attributes_value=value, > > organization_id=organization_id, > > resource_id=id or None, # filter out empty string > > ) > > > > url = self.construct_versioned_url( > > base_url=self.ge_cloud_base_url, > > organization_id=organization_id, > > resource_name=self.ge_cloud_resource_name, > > ) > > > > if id: > > url = urljoin(f"{url}/", id) > > > > try: > > response = self._session.put(url, json=data) > > response_status_code = response.status_code > > > > # 2022-07-28 - Chetan - GX Cloud does not currently support PUT requests > > # for the ExpectationSuite endpoint. As such, this is a temporary fork to > > # ensure that legacy PATCH behavior is supported. > > if ( > > response_status_code == 405 # noqa: PLR2004 > > and resource_type is GXCloudRESTResource.EXPECTATION_SUITE > > ): > > response = self._session.patch(url, json=data) > > response_status_code = response.status_code > > > > > response.raise_for_status() > > > > .../hostedtoolcache/Python/3.9.20......................................./x64/lib/python3.9.../data_context/store/gx_cloud_store_backend.py:298: > > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > > > > self = > > > > def raise_for_status(self): > > """Raises :class:`HTTPError`, if one occurred.""" > > > > http_error_msg = "" > > if isinstance(self.reason, bytes): > > # We attempt to decode utf-8 first because some servers > > # choose to localize their reason strings. If the string > > # isn't utf-8, we fall back to iso-8859-1 for all other > > # encodings. (See PR #3538) > > try: > > reason = self.reason.decode("utf-8") > > except UnicodeDecodeError: > > reason = self.reason.decode("iso-8859-1") > > else: > > reason = self.reason > > > > if 400 <= self.status_code < 500: > > http_error_msg = ( > > f"{self.status_code} Client Error: {reason} for url: {self.url}" > > ) > > > > elif 500 <= self.status_code < 600: > > http_error_msg = ( > > f"{self.status_code} Server Error: {reason} for url: {self.url}" > > ) > > > > if http_error_msg: > > > raise HTTPError(http_error_msg, response=self) > > E requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http://localhost:.../0ccac18e-7631-4bdd-8a42-3c35cce574c6/datasources/758a6903-de5b-415f-a003-a5e921931eb3 > > > > .../hostedtoolcache/Python/3.9.20......................................./x64/lib/python3.9.../site-packages/requests/models.py:1024: HTTPError > > > > The above exception was the direct cause of the following exception: > > > > valid_file_path = PosixPath('.../test_sets/taxi_yellow_tripdata_samples/yellow_tripdata_sample_2018-03.csv') > > > > @pytest.mark.cloud > > def test_cloud_get_csv_asset_not_in_memory(valid_file_path: pathlib.Path): > > # this test runs end-to-end in a real Cloud Data Context > > context = gx.get_context(mode="cloud") > > csv_asset_name = f"DA_{uuid.uuid4().hex}" > > datasource = context.data_sources.pandas_default > > > _ = datasource.add_csv_asset( > > name=csv_asset_name, > > filepath_or_buffer=valid_file_path, > > ) > > > > .../datasource/fluent/test_pandas_datasource.py:480: > > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > > .../hostedtoolcache/Python/3.9.20......................................./x64/lib/python3.9.../datasource/fluent/pandas_datasource.py:785: in add_csv_asset > > return self._add_asset(asset=asset) > > .../hostedtoolcache/Python/3.9.20......................................./x64/lib/python3.9.../datasource/fluent/pandas_datasource.py:603: in _add_asset > > return super()._add_asset(asset=asset, connect_options=connect_options) > > .../hostedtoolcache/Python/3.9.20......................................./x64/lib/python3.9.../datasource/fluent/interfaces.py:871: in _add_asset > > updated_datasource = self._data_context._update_fluent_datasource(datasource=self) > > .../hostedtoolcache/Python/3.9.20......................................./x64/lib/python3.9.../data_context/data_context/abstract_data_context.py:595: in _update_fluent_datasource > > updated_datasource = self.data_sources.all().set_datasource( > > .../hostedtoolcache/Python/3.9.20......................................./x64/lib/python3.9.../great_expectations/datasource/datasource_dict.py:84: in set_datasource > > datasource = self._datasource_store.set(key=None, value=config) > > .../hostedtoolcache/Python/3.9.20......................................./x64/lib/python3.9.../data_context/store/datasource_store.py:223: in set > > return self._persist_datasource(key=key, config=value) > > .../hostedtoolcache/Python/3.9.20......................................./x64/lib/python3.9.../data_context/store/datasource_store.py:230: in _persist_datasource > > ref: Optional[Union[bool, GXCloudResourceRef]] = super().set(key=key, value=config) > > .../hostedtoolcache/Python/3.9.20......................................./x64/lib/python3.9.../data_context/store/store.py:293: in set > > return self._store_backend.set(self.key_to_tuple(key), self.serialize(value), **kwargs) > > .../hostedtoolcache/Python/3.9.20......................................./x64/lib/python3.9.../data_context/store/_store_backend.py:132: in set > > return self._set(key, value, **kwargs) > > .../hostedtoolcache/Python/3.9.20......................................./x64/lib/python3.9.../data_context/store/gx_cloud_store_backend.py:363: in _set > > return self._put(id=id, value=value) > > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > > > > self = > > id = '758a6903-de5b-415f-a003-a5e921931eb3' > > value = {'assets': [{'filepath_or_buffer': '.../tests/test_sets/taxi_yello..., 'type': 'csv'}], 'id': '758a6903-de5b-415f-a003-a5e921931eb3', 'name': 'default_pandas_datasource', 'type': 'pandas'} > > > > def _put(self, id: str, value: Any) -> GXCloudResourceRef | bool: > > # This wonky signature is a sign that our abstractions are not helping us. > > # The cloud backend returns a bool for some resources, and the updated > > # resource for others. Since we route all update calls through this single > > # method, we need to handle both cases. > > > > resource_type = self.ge_cloud_resource_type > > organization_id = self.ge_cloud_credentials["organization_id"] > > attributes_key = self.PAYLOAD_ATTRIBUTES_KEYS[resource_type] > > > > data = self.construct_versioned_payload( > > resource_type=resource_type.value, > > attributes_key=attributes_key, > > attributes_value=value, > > organization_id=organization_id, > > resource_id=id or None, # filter out empty string > > ) > > > > url = self.construct_versioned_url( > > base_url=self.ge_cloud_base_url, > > organization_id=organization_id, > > resource_name=self.ge_cloud_resource_name, > > ) > > > > if id: > > url = urljoin(f"{url}/", id) > > > > try: > > response = self._session.put(url, json=data) > > response_status_code = response.status_code > > > > # 2022-07-28 - Chetan - GX Cloud does not currently support PUT requests > > # for the ExpectationSuite endpoint. As such, this is a temporary fork to > > # ensure that legacy PATCH behavior is supported. > > if ( > > response_status_code == 405 # noqa: PLR2004 > > and resource_type is GXCloudRESTResource.EXPECTATION_SUITE > > ): > > response = self._session.patch(url, json=data) > > response_status_code = response.status_code > > > > response.raise_for_status() > > > > HTTP_NO_CONTENT = 204 > > if response_status_code == HTTP_NO_CONTENT: > > # endpoint has returned NO_CONTENT, so the caller expects a boolean > > return True > > else: > > # expect that there's a JSON payload associated with this response > > response_json = response.json() > > return GXCloudResourceRef( > > resource_type=resource_type, > > id=id, > > url=url, > > response_json=response_json, > > ) > > > > except requests.HTTPError as http_exc: > > > raise StoreBackendError( # noqa: TRY003 > > f"Unable to update object in GX Cloud Store Backend: {get_user_friendly_error_message(http_exc)}" # noqa: E501 > > ) from http_exc > > E great_expectations.exceptions.exceptions.StoreBackendError: Unable to update object in GX Cloud Store Backend: Please contact the Great Expectations team at support@greatexpectations.io > > > > .../hostedtoolcache/Python/3.9.20......................................./x64/lib/python3.9.../data_context/store/gx_cloud_store_backend.py:315: StoreBackendError > > ``` > >
tests.integration.cloud.end_to_end.test_pandas_filesystem_datasource::test_checkpoint_run[parquet_batch_definition]
Stack Traces | 4.39s run time > > ```python > No failure message available > ```
tests.integration.cloud.end_to_end.test_pandas_filesystem_datasource::test_checkpoint_run[csv_batch_definition]
Stack Traces | 6.8s run time > > ```python > No failure message available > ```

To view more test analytics, go to the Test Analytics Dashboard Got feedback? Let us know on Github