SAP / SAP/python-pyodata

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.

chore
Dominant language
Python
Stars
268
Forks
100
PR merge metrics
No merged PRs in 30d

Description

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+

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.

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.