Skip to content

Commit

Permalink
Fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchop committed Apr 2, 2024
1 parent 12c2a5b commit cdd312f
Showing 1 changed file with 24 additions and 32 deletions.
56 changes: 24 additions & 32 deletions dftimewolf/lib/processors/gcp_cloud_resource_tree_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,39 +316,31 @@ def __str__(self) -> str:

def AsDict(self) -> Dict[str, Any]:
"""Returns a dictionary representation of the resource object."""
creation_timestamp = ""
if self.creation_timestamp:
creation_timestamp = self.creation_timestamp.astimezone(
datetime.timezone.utc
).strftime("%Y-%m-%dT%H:%M:%SZ")
deletion_timestamp = ""
if self.deletion_timestamp:
deletion_timestamp = self.deletion_timestamp.astimezone(
datetime.timezone.utc
).strftime("%Y-%m-%dT%H:%M:%SZ")
return {
'id':
self.id,
'name':
self.name,
'type':
self.type,
'project_id':
self.project_id,
'location':
self.location,
'created_by':
self.created_by,
'creator_ip_address':
self.creator_ip_address,
'creator_useragent':
self.creator_useragent,
'deleted_by':
self.deleted_by,
'deleter_ip_address':
self.deleter_ip_address,
'deleter_useragent':
self.deleter_useragent,
'resource_name':
self.resource_name,
'creation_timestamp':
self.creation_timestamp.astimezone(
datetime.timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ')
if self.creation_timestamp else '',
'deletion_timestamp':
self.deletion_timestamp.astimezone(
datetime.timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ')
if self.deletion_timestamp else ''
"id": self.id,
"name": self.name,
"type": self.type,
"project_id": self.project_id,
"location": self.location,
"created_by": self.created_by,
"creator_ip_address": self.creator_ip_address,
"creator_useragent": self.creator_useragent,
"deleted_by": self.deleted_by,
"deleter_ip_address": self.deleter_ip_address,
"deleter_useragent": self.deleter_useragent,
"resource_name": self.resource_name,
"creation_timestamp": creation_timestamp,
"deletion_timestamp": deletion_timestamp,
}

def ToDataFrame(self) -> pd.DataFrame:
Expand Down

0 comments on commit cdd312f

Please sign in to comment.