(self)
| 784 | assert actual.t.encoding["calendar"] == expected_calendar |
| 785 | |
| 786 | def test_roundtrip_timedelta_data(self) -> None: |
| 787 | # todo: suggestion from review: |
| 788 | # roundtrip large microsecond or coarser resolution timedeltas, |
| 789 | # though we cannot test that until we fix the timedelta decoding |
| 790 | # to support large ranges |
| 791 | time_deltas = pd.to_timedelta(["1h", "2h", "NaT"]).as_unit("s") # type: ignore[arg-type, unused-ignore] |
| 792 | encoding = {"units": "seconds"} |
| 793 | expected = Dataset({"td": ("td", time_deltas), "td0": time_deltas[0]}) |
| 794 | expected["td"].encoding = encoding |
| 795 | expected["td0"].encoding = encoding |
| 796 | with self.roundtrip( |
| 797 | expected, open_kwargs={"decode_timedelta": CFTimedeltaCoder(time_unit="s")} |
| 798 | ) as actual: |
| 799 | assert_identical(expected, actual) |
| 800 | |
| 801 | def test_roundtrip_timedelta_data_via_dtype( |
| 802 | self, time_unit: PDDatetimeUnitOptions |
nothing calls this directly
no test coverage detected