You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "shipragoyal07 (via GitHub)" <gi...@apache.org> on 2025/03/26 13:13:31 UTC

[I] Not able to Read compressed csv file without passing any size limit [beam]

shipragoyal07 opened a new issue, #34435:
URL: https://github.com/apache/beam/issues/34435

   Not able to Read compressed csv file without passing any size limit.
   Error: '<' not supported between instances of 'int' and 'NoneType'
   
   Language: Python
   Version: 3.11
   Apache beam version: 2.62.0
   [](url)
   
   Code block:
   `from apache_beam.io.filesystems import FileSystems
   with FileSystems.open(gcs_file_uri, 'rb') as file:
       raw_content = file.read()`
   
   where `gcs_file_uri` is GCS path of the file
   
   Error function: _fetch_to_internal_buffer in module: https://beam.apache.org/releases/pydoc/current/_modules/apache_beam/io/filesystem.html
   Line: while not self._read_eof and (self._read_buffer.tell() -
                                     self._read_position) < num_bytes:
   
   where while passing nothing in file.read(), the condition is comparing 0 < None which is uncomparable and hence raising exception.
   When passing file.read(10000), its comparing 0<0 which is satisfying the condition and hence working fine.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [BUG] | Not able to Read compressed csv file without passing any size limit [beam]

Posted by "liferoad (via GitHub)" <gi...@apache.org>.
liferoad closed issue #34435: [BUG] | Not able to Read compressed csv file without passing any size limit
URL: https://github.com/apache/beam/issues/34435


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [BUG] | Not able to Read compressed csv file without passing any size limit [beam]

Posted by "TanuSharma2511 (via GitHub)" <gi...@apache.org>.
TanuSharma2511 commented on issue #34435:
URL: https://github.com/apache/beam/issues/34435#issuecomment-2761912936

   I think I was able to trace the code. Because we are trying to open GCS path, from the [fileSystems.get_filesystem(path)](https://github.com/apache/beam/blob/3887dcbac583d7a11e6f874dca458a60bc688386/sdks/python/apache_beam/io/filesystems.py#L279C30-L279C50), fileSystem will be "GCSFileSystem". So, we are using [CompressedFile](https://github.com/apache/beam/blob/a81d7ccb7877b71a30f2694ee42ebbb4bc748068/sdks/python/apache_beam/io/gcp/gcsfilesystem.py#L157) here and when we are using file.read(), we are calling [read()](https://github.com/apache/beam/blob/3887dcbac583d7a11e6f874dca458a60bc688386/sdks/python/apache_beam/io/filesystem.py#L294) method of CompressedFile class.
   
   I think, [here](https://github.com/apache/beam/blob/3887dcbac583d7a11e6f874dca458a60bc688386/sdks/python/apache_beam/io/filesystem.py#L297) we can add:
   ```if num_bytes is None:
       num_bytes = DEFAULT_READ_BUFFER_SIZE```
   
   Can anyone confirm this before I proceed to create a PR ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [BUG] | Not able to Read compressed csv file without passing any size limit [beam]

Posted by "liferoad (via GitHub)" <gi...@apache.org>.
liferoad commented on issue #34435:
URL: https://github.com/apache/beam/issues/34435#issuecomment-2761925467

   @shunping 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [BUG] | Not able to Read compressed csv file without passing any size limit [beam]

Posted by "liferoad (via GitHub)" <gi...@apache.org>.
liferoad closed issue #34435: [BUG] | Not able to Read compressed csv file without passing any size limit
URL: https://github.com/apache/beam/issues/34435


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Not able to Read compressed csv file without passing any size limit [beam]

Posted by "shipragoyal07 (via GitHub)" <gi...@apache.org>.
shipragoyal07 commented on issue #34435:
URL: https://github.com/apache/beam/issues/34435#issuecomment-2754362033

   <img width="909" alt="Image" src="https://github.com/user-attachments/assets/28f843c7-7fb9-48eb-b866-a7b0849eaf7f" />
   <img width="970" alt="Image" src="https://github.com/user-attachments/assets/f01565e2-de5f-4a57-abdf-ad40815689e4" />
   <img width="502" alt="Image" src="https://github.com/user-attachments/assets/70b045d1-5998-417c-b6a2-da28dda86930" />
   <img width="401" alt="Image" src="https://github.com/user-attachments/assets/be9fd253-6fc1-475e-b392-f59925fce2c2" />


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [BUG] | Not able to Read compressed csv file without passing any size limit [beam]

Posted by "TanuSharma2511 (via GitHub)" <gi...@apache.org>.
TanuSharma2511 commented on issue #34435:
URL: https://github.com/apache/beam/issues/34435#issuecomment-2756821806

   .take-issue


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org