Skip to content

Commit

Permalink
Merge pull request #140 from rudderlabs/fix-eventFieldCollision(ETL-72)
Browse files Browse the repository at this point in the history
fix: renames event to fix collision
  • Loading branch information
a-rampalli committed Aug 17, 2023
2 parents 430b14a + 709f9b5 commit 879d941
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,16 @@ def process_response(self, response: requests.Response, **kwargs) -> Iterable[Ma
# We prefer response.iter_lines() to response.text.split_lines() as the later can missparse text properties embeding linebreaks
for record in self.iter_dicts(response.iter_lines(decode_unicode=True)):
# transform record into flat dict structure
item = {"event": record["event"]}
item = {"mixpanel_event": record["event"]}
properties = record["properties"]
for result in transform_property_names(properties.keys()):
# Convert all values to string (this is default property type)
# because API does not provide properties type information
item[result.transformed_name] = str(properties[result.source_name])

# convert timestamp to datetime string
item["time"] = pendulum.from_timestamp(int(item["time"]), tz="UTC").to_iso8601_string()
if "time" in item: # time is not always present in the response
item["time"] = pendulum.from_timestamp(int(item["time"]), tz="UTC").to_iso8601_string()

yield item

Expand Down

0 comments on commit 879d941

Please sign in to comment.