@@ -833,28 +833,25 @@ def infer_dtype_from_scalar(val) -> tuple[DtypeObj, Any]:
833
833
834
834
dtype = ArrowDtype (pa_dtype )
835
835
836
- elif isinstance (val , dt .time ):
837
- if val .tzinfo is None :
838
- # pyarrow doesn't have a dtype for timetz.
839
- opt = get_option ("future.infer_time" )
840
- if opt is None :
841
- warnings .warn (
842
- "Pandas type inference with a `datetime.time` "
843
- "object is deprecated. In a future version, this will give "
844
- "time32[pyarrow] dtype, which will require pyarrow to be "
845
- "installed. To opt in to the new behavior immediately set "
846
- "`pd.set_option('future.infer_time', True)`. To keep the "
847
- "old behavior pass `dtype=object`." ,
848
- FutureWarning ,
849
- stacklevel = find_stack_level (),
850
- )
851
- elif opt is True :
852
- import pyarrow as pa
836
+ elif isinstance (val , dt .date ):
837
+ opt = get_option ("future.infer_date" )
838
+ if opt is None :
839
+ warnings .warn (
840
+ "Pandas type inference with a `datetime.date` "
841
+ "object is deprecated. In a future version, this will give "
842
+ "date32[pyarrow] dtype, which will require pyarrow to be "
843
+ "installed. To opt in to the new behavior immediately set "
844
+ "`pd.set_option('future.infer_date', True)`. To keep the "
845
+ "old behavior pass `dtype=object`." ,
846
+ FutureWarning ,
847
+ stacklevel = find_stack_level (),
848
+ )
849
+ elif opt is True :
850
+ import pyarrow as pa
853
851
854
- pa_dtype = pa .time64 ("us" )
855
- from pandas .core .arrays .arrow import ArrowDtype
852
+ pa_dtype = pa .date32 ()
856
853
857
- dtype = ArrowDtype (pa_dtype )
854
+ dtype = ArrowDtype (pa_dtype )
858
855
859
856
elif is_bool (val ):
860
857
dtype = np .dtype (np .bool_ )
0 commit comments