From 5dfa3d29fdef3755e4f0c3b2387f8617dbfd64ec Mon Sep 17 00:00:00 2001 From: Colin Ho Date: Thu, 15 Feb 2024 12:53:54 +0800 Subject: [PATCH] dont change tests --- daft/dataframe/dataframe.py | 5 ++++- tests/integration/io/test_url_download_http.py | 2 -- tests/udf_library/test_url_udfs.py | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/daft/dataframe/dataframe.py b/daft/dataframe/dataframe.py index 0f6ecef9d2..236daca198 100644 --- a/daft/dataframe/dataframe.py +++ b/daft/dataframe/dataframe.py @@ -242,7 +242,9 @@ def _populate_preview(self) -> None: preview_results = preview_df._result assert preview_results is not None + print("here") preview_partition = preview_results._get_merged_vpartition() + print("not here") self._preview = DataFramePreview( preview_partition=preview_partition, dataframe_num_rows=len(self), @@ -1153,10 +1155,11 @@ def collect(self, num_preview_rows: Optional[int] = 8) -> "DataFrame": self._materialize_results() assert self._result is not None + dataframe_len = len(self._result) if num_preview_rows is not None: self._num_preview_rows = num_preview_rows else: - self._num_preview_rows = len(self._result) + self._num_preview_rows = dataframe_len return self def _construct_show_display(self, n: int) -> "DataFrameDisplay": diff --git a/tests/integration/io/test_url_download_http.py b/tests/integration/io/test_url_download_http.py index 3b0dc3a499..531b89907a 100644 --- a/tests/integration/io/test_url_download_http.py +++ b/tests/integration/io/test_url_download_http.py @@ -30,7 +30,6 @@ def test_url_download_http_error_codes(nginx_config, use_native_downloader, stat if status_code == 404: with pytest.raises(FileNotFoundError): df.collect() - df.__repr__() # When using fsspec, other error codes are bubbled up to the user as aiohttp.client_exceptions.ClientResponseError elif not use_native_downloader: # Ray runner has a pretty catastrophic failure when raising non-pickleable exceptions (ClientResponseError is not pickleable) @@ -46,4 +45,3 @@ def test_url_download_http_error_codes(nginx_config, use_native_downloader, stat # user-facing I/O error with the error code with pytest.raises(ValueError, match=f"{status_code}") as e: df.collect() - df.__repr__() diff --git a/tests/udf_library/test_url_udfs.py b/tests/udf_library/test_url_udfs.py index aee414c674..a8daee4596 100644 --- a/tests/udf_library/test_url_udfs.py +++ b/tests/udf_library/test_url_udfs.py @@ -87,7 +87,6 @@ def test_download_with_missing_urls_reraise_errors(files, use_native_downloader) # TODO: Change to a FileNotFound Error with pytest.raises(FileNotFoundError): df.collect() - df.__repr__() @pytest.mark.parametrize("use_native_downloader", [False, True])