[ 
https://issues.apache.org/jira/browse/BEAM-14314?focusedWorklogId=765145&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-765145
 ]

ASF GitHub Bot logged work on BEAM-14314:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/May/22 21:06
            Start Date: 02/May/22 21:06
    Worklog Time Spent: 10m 
      Work Description: pabloem commented on code in PR #17380:
URL: https://github.com/apache/beam/pull/17380#discussion_r863190457


##########
sdks/python/apache_beam/io/gcp/gcsio.py:
##########
@@ -532,39 +510,85 @@ 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)

Review Comment:
   same - have you checked that the GCS client returns this object type as 
expected?





Issue Time Tracking
-------------------

    Worklog Id:     (was: 765145)
    Time Spent: 4h 50m  (was: 4h 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: 4h 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)

Reply via email to