Skip to content

Bug: response type for datetime values in json dict inaccurately marked as datetime #246

@onerandomusername

Description

@onerandomusername

created_at: datetime
updated_at: datetime

While these values are parsed to datetimes, they don't come from the API as a datetime. This causes typing issues when using the raw dictionaries rather than the parsed classes.

example:

resp = github.rest.users.async_get_by_username(username)
user_data = resp.json()

reveal_type(user_data['created_at']] # revealed to be a datetime
assert isinstance(user_data['created_at'], datetime) # will return false

Metadata

Metadata

Assignees

Labels

Rest APIbugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions