Skip to content

read() returns incomplete file? (not clear on documentation) #233

@fernandobrito

Description

@fernandobrito

Hello,

This is my first time using the library, so please apologize me if I'm missing something obvious.

I'm trying to read a .csv.gz file (quite small, less than 100kb) following the documentation (https://gcsfs.readthedocs.io/en/latest/#examples), by doing:

fs = gcsfs.GCSFileSystem(project=project_id, token=service_key_path)
uri = bucket_name + '/' + filename
with fs.open(uri, 'rb') as f:
    content = f.read()

Here, I expect content to have the entire file, but it has only 168 rows (out of 946 in total). Reading the same file with google-cloud-storage works fine.

storage_client = storage.Client(credentials=credentials, project=project_id)
bucket = storage_client.bucket(bucket_name)
blob = bucket.blob(filename)
content = blob.download_as_string()

What am I missing?
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions