Skip to content

TST: test_to_csv_compression_encoding_gcs fails sometimes #39286

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

Closed
twoertwein opened this issue Jan 20, 2021 · 0 comments
Closed

TST: test_to_csv_compression_encoding_gcs fails sometimes #39286

twoertwein opened this issue Jan 20, 2021 · 0 comments
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member

Comments

@twoertwein
Copy link
Member

twoertwein commented Jan 20, 2021

only seems to happen sometimes in "Database / Linux_py37_cov"

_______________ test_to_csv_compression_encoding_gcs[zip-cp1251] _______________
[gw1] linux -- Python 3.7.9 /usr/share/miniconda/envs/pandas-dev/bin/python

gcs_buffer = <_io.BytesIO object at 0x7f4959d0b650>, compression_only = 'zip'
encoding = 'cp1251'

    @td.skip_if_no("gcsfs")
    @pytest.mark.parametrize("encoding", ["utf-8", "cp1251"])
    def test_to_csv_compression_encoding_gcs(gcs_buffer, compression_only, encoding):
        """
        Compression and encoding should with GCS.
    
        GH 35677 (to_csv, compression), GH 26124 (to_csv, encoding), and
        GH 32392 (read_csv, encoding)
        """
        from fsspec import registry
    
        registry.target.clear()  # remove state
        df = tm.makeDataFrame()
    
        # reference of compressed and encoded file
        compression = {"method": compression_only}
        if compression_only == "gzip":
            compression["mtime"] = 1  # be reproducible
        buffer = BytesIO()
        df.to_csv(buffer, compression=compression, encoding=encoding, mode="wb")
    
        # write compressed file with explicit compression
        path_gcs = "gs://test/test.csv"
        df.to_csv(path_gcs, compression=compression, encoding=encoding)
>       assert gcs_buffer.getvalue() == buffer.getvalue()
E       AssertionError: assert b'PK\x03\x04\...0\x00\x00\x00' == b'PK\x03\x04\...0\x00\x00\x00'
E         At index 10 diff: b'\xa6' != b'\xa5'
E         Use -v to get the full diff
@twoertwein twoertwein added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Jan 20, 2021
@twoertwein twoertwein mentioned this issue Jan 21, 2021
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member
Projects
None yet
Development

No branches or pull requests

1 participant