Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Aug 12, 2021

extra metadata:

  • account_id
  • account_name
  • task_id

@ghost ghost force-pushed the LITE-19830-add-extra-metadata-to-logs branch from 800f7ce to a47effe Compare August 12, 2021 16:35
return dataclasses.asdict(self)

@classmethod
def from_json(cls, data):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as we discussed, better from_dict and to_dict

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@ghost ghost force-pushed the LITE-19830-add-extra-metadata-to-logs branch from a47effe to 687b1e1 Compare August 12, 2021 16:41
return dataclasses.asdict(self)

@classmethod
def from_dict(cls, data):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly for me dataclasses are something about the type and structure. That's why I don't think it is needed for some methods here. Especially if you need to copy it across all dataclasses. Why not to use existing dataclasses.asdict() and implement one like fromdict(cls, data)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Wait for a background task to be completed and than uild the task result message.
"""
result_message = TaskPayload(**task_data.to_json())
result_message = TaskPayload(**task_data.to_dict())
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, but looks like for copying the instances there is a specific method - link

pass

def get_client(self):
def get_client(self, task_id):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like here you didn't change comment for the function

@ghost ghost force-pushed the LITE-19830-add-extra-metadata-to-logs branch from 687b1e1 to 638e2c9 Compare August 13, 2021 08:15
@ghost ghost requested review from d3rky and marcserrat August 13, 2021 08:16
@ghost ghost merged commit e192613 into master Aug 13, 2021
@marcserrat marcserrat deleted the LITE-19830-add-extra-metadata-to-logs branch August 13, 2021 09:23
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants