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 a ValidationError when requesting a Playlist without a cover image #309

Merged
merged 3 commits into from Dec 20, 2023

Conversation

Kuwertzel
Copy link
Contributor

@Kuwertzel Kuwertzel commented Dec 16, 2023

Changed the type the of the images attribute in the Playlist base class to a nullable list to avoid a pydantic ValidationError in cases where the API returns null. This happens when requesting an empty playlist without a custom image.

Related issue: none created

  • Tests written with 100% coverage
  • Documentation and changelog entry written

Some tox checks have failed in my environment, though the errors don't seem to be related to the implemented change.

I have manually tested the change by requesting an emtpy playlist using spotify.playlist('<playlist-id>'), which resulted in the following (shortened) traceback prior to the change:

pydantic_core._pydantic_core.ValidationError: 1 validation error for FullPlaylist
images
  Input should be a valid list [type=list_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.3/v/list_type

Copy link
Owner

@felix-hilden felix-hilden left a comment

Choose a reason for hiding this comment

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

Thank you for submitting the fix directly! Just a wording update suggestion on the changelog, I like to keep a certain style and add links 👌

docs/src/release_notes.rst Outdated Show resolved Hide resolved
Co-authored-by: Felix Hildén <felix.hilden@gmail.com>
@felix-hilden felix-hilden merged commit afcf97a into felix-hilden:master Dec 20, 2023
5 of 6 checks passed
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.

None yet

2 participants