Skip to content

set_user stringifies None dict values #6689

Description

@constantinius

How do you use Sentry?

Sentry Saas (sentry.io)

Version

master

Steps to Reproduce

When using set_user() in a way that some dict-values are None, these values are getting and showing up as non-null values in the product

set_user({"email": None, "username": None})

In _apply_user_attributes_to_telemetry these values are applied to the span and in serialize_attribute() they are stringified, as it does not recognize None as a special case but just stringifies it.

Expected Result

Either the values should be dropped (as in: not set in the span) or be left but null.

Also set_user() has the following signature:

def set_user(self, value: "Optional[Dict[str, Any]]") -> None:

This would indicate to me that None values are allowed, but serialize_attribute does not allow for None

Actual Result

Image

Metadata

Metadata

Assignees

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions