How to add unitful support for axline

Currently axline does not support unit. The following code would fail.

import matplotlib.pyplot as plt
import datetime
import matplotlib as mpl
mpl.rcParams["date.converter"] = 'concise'
fig, ax1 = plt.subplots(1, 1,
                                    figsize=(10, 12))
start_date = datetime.datetime(2023, 1, 1)
dates = [start_date + datetime.timedelta(days=i) for i in range(31)]
values = list(range(1, 32))
ax1.plot(dates, values, 'ro')
ax1.axline((dates[0], values[0]), (dates[-1], values[-1]),
           color='blue', linewidth=2)
ax1.set_title('Datetime vs. Number')

I was trying to create an unit test for the and it was rejected because axline does not support units. Any solid idea with example on how to implement the unit for axline?