Skip to content

fix: Keep None values for user_data in Request#1707

Merged
Pijukatel merged 1 commit into
apify:masterfrom
Mantisus:keep-none-user-data
Feb 3, 2026
Merged

fix: Keep None values for user_data in Request#1707
Pijukatel merged 1 commit into
apify:masterfrom
Mantisus:keep-none-user-data

Conversation

@Mantisus

@Mantisus Mantisus commented Feb 2, 2026

Copy link
Copy Markdown
Collaborator

Description

  • This PR fixes loss of None values in user_data during Request serialization

Issues

@Mantisus Mantisus requested a review from Copilot February 2, 2026 21:59
@Mantisus Mantisus self-assigned this Feb 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug in the Request class where None values in the user_data field were being excluded during serialization. The change ensures that explicit None values are preserved by setting exclude_none=False in the serialization configuration.

Changes:

  • Modified the user_data serialization behavior to retain explicit None values

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Mantisus Mantisus requested a review from Pijukatel February 2, 2026 22:00
@Mantisus Mantisus force-pushed the keep-none-user-data branch from 4a56bff to 83614f7 Compare February 2, 2026 22:54
Comment thread src/crawlee/_request.py
lambda instance: user_data_adapter.dump_python(
instance,
by_alias=True,
exclude_none=True,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@janbuchar do you remember if this had any specific reason?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No, I don't. The new behavior seems more explicit and I can't think of a problem that I could cause, so let's do this

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No, I don't. The new behavior seems more explicit and I can't think of a problem that I could cause, so let's do this

@Pijukatel Pijukatel merged commit 3c575bc into apify:master Feb 3, 2026
29 of 30 checks passed
Mantisus added a commit to Mantisus/crawlee-python that referenced this pull request Feb 9, 2026
### Description

- This PR fixes loss of `None` values in `user_data` during `Request`
serialization

### Issues

- Closes: apify#1706
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants