@@ -818,13 +818,19 @@ def test_query_into_dataframe(self):
818
818
pd1 = pd .DataFrame (
819
819
[[23422 ]], columns = ['value' ],
820
820
index = pd .to_datetime (["2009-11-10T23:00:00Z" ]))
821
- pd1 .index = pd1 .index .tz_localize ('UTC' )
821
+ try :
822
+ pd1 .index = pd1 .index .tz_localize ('UTC' )
823
+ except TypeError :
824
+ pd1 .index = pd1 .index .tz_convert ('UTC' )
822
825
pd2 = pd .DataFrame (
823
826
[[23422 ], [23422 ], [23422 ]], columns = ['value' ],
824
827
index = pd .to_datetime (["2009-11-10T23:00:00Z" ,
825
828
"2009-11-10T23:00:00Z" ,
826
829
"2009-11-10T23:00:00Z" ]))
827
- pd2 .index = pd2 .index .tz_localize ('UTC' )
830
+ try :
831
+ pd2 .index = pd2 .index .tz_localize ('UTC' )
832
+ except TypeError :
833
+ pd2 .index = pd2 .index .tz_convert ('UTC' )
828
834
expected = {
829
835
('network' , (('direction' , '' ),)): pd1 ,
830
836
('network' , (('direction' , 'in' ),)): pd2
@@ -871,11 +877,18 @@ def test_multiquery_into_dataframe(self):
871
877
index = pd .to_datetime ([
872
878
"2015-01-29 21:55:43.702900257+0000" ,
873
879
"2015-01-29 21:55:43.702900257+0000" ,
874
- "2015-06-11 20:46:02+0000" ])).tz_localize ('UTC' )
880
+ "2015-06-11 20:46:02+0000" ]))
881
+ try :
882
+ pd1 = pd1 .tz_localize ('UTC' )
883
+ except TypeError :
884
+ pd1 = pd1 .tz_convert ('UTC' )
875
885
pd2 = pd .DataFrame (
876
886
[[3 ]], columns = ['count' ],
877
- index = pd .to_datetime (["1970-01-01 00:00:00+00:00" ]))\
878
- .tz_localize ('UTC' )
887
+ index = pd .to_datetime (["1970-01-01 00:00:00+00:00" ]))
888
+ try :
889
+ pd2 = pd2 .tz_localize ('UTC' )
890
+ except TypeError :
891
+ pd2 = pd2 .tz_convert ('UTC' )
879
892
expected = [{'cpu_load_short' : pd1 }, {'cpu_load_short' : pd2 }]
880
893
881
894
cli = DataFrameClient ('host' , 8086 , 'username' , 'password' , 'db' )
0 commit comments