Doist / Doist/todoist-api-python

Due date's type is partially unknown in pyright strict mode

Open
#193 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
250
Forks
34
Avg merge
6d 10h
Merged PRs (30d)
1

Description

Bug description

I'm running into an issue with the ApiDue type where pyright (and basedpyright) report it as being partially unknown in strict mode.

error: Type of "date" is partially unknown
Type of "date" is "DatePattern[Unknown] | DateTimePattern[Unknown] | UTCDateTimePattern[Unknown]" [reportUnknownMemberType]

It's entirely possible that I'm doing something wrong here, or this is an issue with pyright/basedpyright, so apologies if this is better as a question rather than a bug report.

Expected behaviour

I expected that the usage of the ApiDue type (e.g. task.due.date) does not give a partially unknown error in pyright strict mode.

Is reproducible

Yes

To reproduce

    todoist_api = TodoistAPIAsync('token')
    task_generator = await todoist_api.filter_tasks(query=filter)
    async for task_list in task_generator:
        for task in task_list:
            if task.due:
                print(task.due.date)

Steps taken to try to reproduce

N/A

Screenshots

Image

Version information:

  • Package version: 3.01
  • Python version: 3.13

Additional information

N/A

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the ApiDue type definition and reproduce the reported task.due.date access with Python 3.13 and pyright strict mode. Trace why the date type retains an unknown parameter, then verify that the reproduction no longer reports a partially unknown type.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.