fromisotime cleanup when 3.11 is Python miniumum

Open Beginner friendly
#304 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Quiet
Tech stack
python
Domain
api

Research direction

Open pyodata/v2/model.py and inspect parse_datetime_literal and EdmDateTimeOffsetTypTraits.from_literal. Confirm the Python 3.11 fromisoformat behavior, then remove the fractional-seconds padding blocks and the Z replacement described in the issue. Done means the compatibility workarounds are gone while fractional seconds and Z inputs remain supported.

Written by the indexing model from the issue text.

Description

chore

Matrix builds for #303 exposed change in fromisotime for fractional-seconds between Python 3.10 and 3.11. Since 3.10 EOL is quite soon, adding what can be changed when support for 3.10 will be dropped as well.

Cleanup tasks for when Python 3.11 becomes minimum version

  • parse_datetime_literal in pyodata/v2/model.py: remove fractional-seconds padding workaround (the if '.' in value block), fromisoformat accepts any number of fractional digits in 3.11+
  • EdmDateTimeOffsetTypTraits.from_literal in pyodata/v2/model.py: remove fractional-seconds padding workaround (the if '.' in normalized block) for the same reason
  • EdmDateTimeOffsetTypTraits.from_literal: remove the .replace('Z', '+00:00') normalisation, fromisoformat accepts Z natively in 3.11+
Dominant language
Python
Stars
268
Forks
100
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

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.

More from SAP/python-pyodata

All issues in SAP/python-pyodata

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.