Skip to content

Commit f4d0360

Browse files
committed
feat: removed unused codes!
1 parent 09acc1e commit f4d0360

1 file changed

Lines changed: 0 additions & 23 deletions

File tree

hivemind_etl/storage/s3_client.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -120,26 +120,3 @@ def get_data_by_key(self, key: str) -> Dict[str, Any]:
120120
raise ValueError(f"No data found for key: {key}")
121121
logging.error(f"Error retrieving data for key {key}: {str(e)}")
122122
raise
123-
124-
def get_latest_data(self, community_id: str, activity_type: str) -> Dict[str, Any]:
125-
"""Get the most recent data for a community and activity type."""
126-
prefix = f"{community_id}/{activity_type}/"
127-
128-
try:
129-
response = self.s3_client.list_objects_v2(
130-
Bucket=self.bucket_name,
131-
Prefix=prefix,
132-
MaxKeys=1,
133-
)
134-
135-
if "Contents" not in response:
136-
logging.error(f"No data found for prefix: {prefix}")
137-
return None
138-
139-
latest_key = response["Contents"][0]["Key"]
140-
return self.get_data_by_key(latest_key)
141-
142-
except ClientError as e:
143-
if e.response["Error"]["Code"] == "NoSuchKey":
144-
return None
145-
raise

0 commit comments

Comments
 (0)