@@ -818,13 +818,15 @@ 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
+ if pd1 .index .tzinfo is None :
822
+ pd1 .index = pd1 .index .tz_localize ('UTC' )
822
823
pd2 = pd .DataFrame (
823
824
[[23422 ], [23422 ], [23422 ]], columns = ['value' ],
824
825
index = pd .to_datetime (["2009-11-10T23:00:00Z" ,
825
826
"2009-11-10T23:00:00Z" ,
826
827
"2009-11-10T23:00:00Z" ]))
827
- pd2 .index = pd2 .index .tz_localize ('UTC' )
828
+ if pd2 .index .tzinfo is None :
829
+ pd2 .index = pd2 .index .tz_localize ('UTC' )
828
830
expected = {
829
831
('network' , (('direction' , '' ),)): pd1 ,
830
832
('network' , (('direction' , 'in' ),)): pd2
@@ -871,11 +873,14 @@ def test_multiquery_into_dataframe(self):
871
873
index = pd .to_datetime ([
872
874
"2015-01-29 21:55:43.702900257+0000" ,
873
875
"2015-01-29 21:55:43.702900257+0000" ,
874
- "2015-06-11 20:46:02+0000" ])).tz_localize ('UTC' )
876
+ "2015-06-11 20:46:02+0000" ]))
877
+ if pd1 .index .tzinfo is None :
878
+ pd1 .index = pd1 .index .tz_localize ('UTC' )
875
879
pd2 = pd .DataFrame (
876
880
[[3 ]], columns = ['count' ],
877
- index = pd .to_datetime (["1970-01-01 00:00:00+00:00" ]))\
878
- .tz_localize ('UTC' )
881
+ index = pd .to_datetime (["1970-01-01 00:00:00+00:00" ]))
882
+ if pd2 .index .tzinfo is None :
883
+ pd2 .index = pd2 .index .tz_localize ('UTC' )
879
884
expected = [{'cpu_load_short' : pd1 }, {'cpu_load_short' : pd2 }]
880
885
881
886
cli = DataFrameClient ('host' , 8086 , 'username' , 'password' , 'db' )
0 commit comments