Commit f9161a5
fix: remove Literal.toPython date conversion for gYear/gYearMonth (#3115)
* fix: remove Literal.toPython casting for gYear and gYearMonth
Issue #3078 reports, that rdflib.Literal.toPython casting of xsd:gYear and
xsd:gYearMonth to datetime objects is not possible, as there is no
appropriate Python equivalence for those types.
The current implementation casts xsd:gYear and xsd:gYearMonth to
datetime objects assuming January 1st for xsd:gYear and the 1st day
of the given month for xsd:gYearMonth. This is plain wrong.
The change removes casting to datetime objects in
rdflib.Literal.toPython for xsd:gYear and xsd:gYearMonth.
Closes #3078 .
* test: adapt rdflib.Literal tests to gYear/gYearMonth toPython change
---------
Co-authored-by: Nicholas Car <[email protected]>1 parent 751cc7c commit f9161a5
File tree
3 files changed
+14
-89
lines changed- rdflib
- test/test_literal
3 files changed
+14
-89
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
74 | 72 | | |
75 | 73 | | |
76 | 74 | | |
| |||
2085 | 2083 | | |
2086 | 2084 | | |
2087 | 2085 | | |
2088 | | - | |
2089 | | - | |
2090 | 2086 | | |
2091 | 2087 | | |
2092 | 2088 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
593 | 593 | | |
594 | 594 | | |
595 | 595 | | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
600 | | - | |
601 | | - | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
616 | | - | |
617 | | - | |
618 | | - | |
619 | | - | |
620 | | - | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | | - | |
646 | | - | |
647 | | - | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | | - | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | 596 | | |
670 | 597 | | |
671 | 598 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
855 | 855 | | |
856 | 856 | | |
857 | 857 | | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
858 | 872 | | |
859 | 873 | | |
860 | 874 | | |
861 | | - | |
862 | | - | |
863 | | - | |
864 | | - | |
865 | | - | |
866 | | - | |
867 | | - | |
868 | | - | |
869 | | - | |
870 | | - | |
871 | | - | |
872 | | - | |
873 | 875 | | |
874 | 876 | | |
875 | 877 | | |
| |||
0 commit comments