[
https://issues.apache.org/jira/browse/BEAM-8467?focusedWorklogId=336466&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-336466
]
ASF GitHub Bot logged work on BEAM-8467:
----------------------------------------
Author: ASF GitHub Bot
Created on: 30/Oct/19 21:08
Start Date: 30/Oct/19 21:08
Worklog Time Spent: 10m
Work Description: chamikaramj commented on pull request #9861:
[BEAM-8467] Enabling reading compressed files
URL: https://github.com/apache/beam/pull/9861#discussion_r340858886
##########
File path: sdks/python/apache_beam/io/fileio_test.py
##########
@@ -163,6 +164,43 @@ def test_csv_file_source(self):
assert_that(content_pc, equal_to(rows))
+ def test_infer_compressed_file(self):
+ dir = '%s%s' % (self._new_tempdir(), os.sep)
+
+ file_contents = b'compressed_contents!'
+ import gzip
+ with gzip.GzipFile(os.path.join(dir, 'compressed.gz'), 'w') as f:
+ f.write(file_contents)
+
+ with TestPipeline() as p:
+ content_pc = (p
+ | beam.Create([FileSystems.join(dir, '*')])
+ | fileio.MatchAll()
+ | fileio.ReadMatches()
+ | beam.Map(lambda rf: rf.open().read(len(file_contents))))
+
+ assert_that(content_pc, equal_to([file_contents]))
+
+ def test_read_compressed_file_without_suffix(self):
Review comment:
Let's also add tests for other compression types we support assuming it is
cheap.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 336466)
Time Spent: 0.5h (was: 20m)
> Enable reading compressed files with Python fileio
> --------------------------------------------------
>
> Key: BEAM-8467
> URL: https://issues.apache.org/jira/browse/BEAM-8467
> Project: Beam
> Issue Type: Improvement
> Components: io-py-files
> Reporter: Pablo Estrada
> Assignee: Pablo Estrada
> Priority: Major
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)