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

[BUG] TypeValidationError on User for certain old broken beatmaps with deleted set owners #244

Open
EnricoBaivo opened this issue Aug 3, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@EnricoBaivo
Copy link
Contributor

Describe the bug
Im receiving an Error for fetching a Beatmapset that doesn't contain all the expected fields
To Reproduce
Steps to reproduce the behavior:

  1. use beatmapset_id =19378
  2. Get get_beatmapset(19378)
beatmapset_id = 19378

    @prepare_token
    @check_token
    @requires_scope(Scopes.PUBLIC)
    async def get_beatmapset(self, beatmapset_id: int) -> Beatmapset:
        r"""Get beatmapset data.
    
        :param beatmapset_id: The ID of the beatmapset
        :type beatmapset_id: int
        :raises APIException: Contains status code and error message
        :raises RefreshTokenExpiredError: If the client refresh token has expired
        :return: Beatmapset data object
        :rtype: aiosu.models.beatmap.Beatmapset
        """
        url = f"{self.base_url}/api/v2/beatmapsets/{beatmapset_id}"
        json = await self._request("GET", url)
>       return Beatmapset.model_validate(json)
E       pydantic_core._pydantic_core.ValidationError: 3 validation errors for Beatmapset
E       user.avatar_url
E         Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
E           For further information visit https://errors.pydantic.dev/2.7/v/string_type
E       user.country_code
E         Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
E           For further information visit https://errors.pydantic.dev/2.7/v/string_type
E       user.id
E         Input should be a valid integer [type=int_type, input_value=None, input_type=NoneType]
E           For further information visit https://errors.pydantic.dev/2.7/v/int_type
´´´
**Expected behavior**
the Beatmapset should be correctly returned
@EnricoBaivo EnricoBaivo added the bug Something isn't working label Aug 3, 2024
@NiceAesth
Copy link
Owner

NiceAesth commented Aug 17, 2024

cannot repro

this is more of an osu-web issue though (which i assume they have since fixed?)

@NiceAesth NiceAesth changed the title [BUG] Typevalidation error for feteched beatmapset [BUG] TypeValidationError for certain old broken beatmaps Aug 17, 2024
@NiceAesth NiceAesth changed the title [BUG] TypeValidationError for certain old broken beatmaps [BUG] TypeValidationError on User for certain old broken beatmaps with deleted set owners Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants