[
https://issues.apache.org/jira/browse/BEAM-14314?focusedWorklogId=762584&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-762584
]
ASF GitHub Bot logged work on BEAM-14314:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 26/Apr/22 22:04
Start Date: 26/Apr/22 22:04
Worklog Time Spent: 10m
Work Description: pabloem commented on code in PR #17380:
URL: https://github.com/apache/beam/pull/17380#discussion_r859182006
##########
sdks/python/apache_beam/io/gcp/gcsio.py:
##########
@@ -532,39 +510,84 @@ def last_updated(self, path):
Returns: last updated time of the GCS object in second.
"""
+ return self._updated_to_seconds(self._gcs_object(path).updated)
+
+ def _status(self, path):
+ """For internal use only; no backwards-compatibility guarantees.
+
+ Returns supported fields (checksum, kms_key, last_updated, size) of a
+ single object as a dict at once.
+
+ This method does not perform glob expansion. Hence the given path must be
+ for a single GCS object.
+
+ Returns: dict of fields of the GCS object.
+ """
+ gcs_object = self._gcs_object(path)
+ file_status = {}
+ if hasattr(gcs_object, 'crc32c'):
+ file_status['checksum'] = gcs_object.crc32c
+ if hasattr(gcs_object, 'kmsKeyName'):
+ file_status['kms_key'] = gcs_object.kmsKeyName
+ if hasattr(gcs_object, 'updated'):
+ file_status['last_updated'] =
self._updated_to_seconds(gcs_object.updated)
+ if hasattr(gcs_object, 'size'): file_status['size'] = gcs_object.size
Review Comment:
separate into two lines like others?
Issue Time Tracking
-------------------
Worklog Id: (was: 762584)
Time Spent: 2h 50m (was: 2h 40m)
> Add last_updated field in filesystem.FileMetaData
> -------------------------------------------------
>
> Key: BEAM-14314
> URL: https://issues.apache.org/jira/browse/BEAM-14314
> Project: Beam
> Issue Type: New Feature
> Components: io-py-common
> Reporter: Yi Hu
> Assignee: Yi Hu
> Priority: P2
> Time Spent: 2h 50m
> Remaining Estimate: 0h
>
> This will be the python counterpart of BEAM-5910
> Per python naming convention, the field will be named as
> "last_updated_in_seconds".
--
This message was sent by Atlassian Jira
(v8.20.7#820007)