Abacn commented on code in PR #17380:
URL: https://github.com/apache/beam/pull/17380#discussion_r859932732
##########
sdks/python/apache_beam/io/hadoopfilesystem_test.py:
##########
@@ -36,14 +37,11 @@ class FakeFile(io.BytesIO):
"""File object for FakeHdfs"""
__hash__ = None # type: ignore[assignment]
- def __init__(self, path, mode='', type='FILE'):
+ def __init__(self, path, mode='', type='FILE', mtime=None):
io.BytesIO.__init__(self)
-
- self.stat = {
- 'path': path,
- 'mode': mode,
- 'type': type,
- }
+ if mtime is None:
+ mtime = int(time.time() * 1000)
+ self.stat = {'path': path, 'mode': mode, 'type': type, 'mtime': mtime}
Review Comment:
It mocks the 'modificationTime' field of WebHDFS FileStatus property which
is a timestamp in millisecond. time_ms is a better name for FakeFile. Changed
now.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]