Skip to content

Commit

Permalink
feat: yemeksepeti comment value transform method was developed.
Browse files Browse the repository at this point in the history
  • Loading branch information
fmelihh committed May 12, 2024
1 parent 94326b9 commit d652f97
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,20 @@ def _iterate_over_comments(self) -> Generator[dict, None, None]:

@staticmethod
def transform_unstructured_data(record_value: dict) -> YemeksepetiCommentValue:
pass
values = dict()
values["comment_id"] = record_value.get("uuid")
values["created_at"] = record_value.get("createdAt")
values["updated_at"] = record_value.get("updatedAt")
values["comment"] = record_value.get("text")
values["reviewer_name"] = record_value.get("reviewerName")
values["reviewer_id"] = record_value.get("reviewerId")
values["rating"] = record_value.get("ratings")
values["comment_like_count"] = record_value.get("likeCount")
values["product_variation"] = record_value.get("productVariations")
values["replies"] = record_value.get("replies")

comment_value = YemeksepetiCommentValue(**values)
return comment_value

def process(
self, process_limit: int | None = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@

@dataclass(frozen=True)
class YemeksepetiCommentValue(CommentValue):
comment_id: str
created_at: datetime.datetime
updated_at: datetime.datetime
comment: str
reviewer_name: str
reviewer_id: str
comment_id: str | None
created_at: datetime.datetime | str | None
updated_at: datetime.datetime | str | None
comment: str | None
reviewer_name: str | None
reviewer_id: str | None
rating: YemekSepetiRating | list[dict] | None
comment_like_count: int
product_variation: list[ProductVariation] | None
replies: list[YemeksepetiReplies] | None
comment_like_count: int | None
product_variation: list[ProductVariation] | list[dict] | None
replies: list[YemeksepetiReplies] | list[dict] | None

0 comments on commit d652f97

Please sign in to comment.