Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed SDK-426 scrubbing for namedtuples #474

Merged
merged 2 commits into from
Feb 14, 2025

Conversation

danielmorell
Copy link
Collaborator

Description of the change

This change fixes an issue where named tuple fields included in scrub_fields were not being scrubbed/redacted before the namedtuple was serialized.

This was caused by the _serialize_frame_data() method running ScrubRedactTransform() without checking the scrub_fields values before serializng the namedtuple. As a result by the time we came to scrub the namedtuple with the scrub_fields values had been serialized to a string.

This PR creates an instance of ScrubRedactTransform during init() that is passed the scrub_fields and used during both _serialize_frame_data() and _transform().

While makeing that change I noticed that ScrubRedactTransform can further do the work of ScrubTransform if it is passed the same arguments during initialization. Because of that I removed ScrubTransform from the list of transforms since ScrubRedactTransform will do both now. This futher reduces the total number of traversals and transforms we need to do of the data, making it more efficient.

Type of change

  • Bug fix (non-breaking change that fixes an issue)

Related issues

  • Fix: SDK-426

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • "Ready for review" label attached to the PR and reviewers assigned
  • Issue from task tracker has a link to this pull request
  • Changes have been reviewed by at least one other engineer

@danielmorell danielmorell added this to the 1.2.0 milestone Feb 14, 2025
Copy link

linear bot commented Feb 14, 2025

@danielmorell danielmorell requested a review from brianr February 14, 2025 19:50
@brianr brianr requested a review from waltjones February 14, 2025 20:04
Copy link
Contributor

@waltjones waltjones left a comment

Choose a reason for hiding this comment

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

👍 Looks good

@danielmorell danielmorell merged commit 44cc2dc into master Feb 14, 2025
89 checks passed
@danielmorell danielmorell deleted the fixed/sdk-426-scrubbing-for-namedtuples branch February 14, 2025 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants