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

Remove obsolete 'priority' built-in field. #154

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

coddingtonbear
Copy link
Collaborator

As long ago as Taskwarrior 2.4.3, the priority field is no longer a built-in field (https://taskwarrior.org/docs/priority.html), and should users re-define priority as a UDA having values other than H, M, and L while the aforementioned field definition is in place, an exception will be raised when deserializing:

Traceback (most recent call last):
  ...
  File "/src/taskw/taskw/task.py", line 197, in serialized
    serialized[k] = self._serialize(k, v, self._fields)
  File "/src/taskw/taskw/task.py", line 116, in _serialize
    return converter.serialize(value)
  File "/src/taskw/taskw/fields/choice.py", line 34, in serialize
    raise ValueError(
ValueError: '0' is not a valid choice; choices: [None, 'H', 'M', 'L']

@bergercookie
Copy link
Contributor

For reference, this would happen during serialization, not deserialization, and AFAICT this is no longer an issue with taskw since UDAs at the time of testing this do update existing fields, e.g., for the priority field.

The relevant part of the code is here:

taskw/taskw/task.py

Lines 68 to 70 in 3256c92

udas = udas or {}
self._fields = self.FIELDS.copy()
self._fields.update(udas)

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.

2 participants