@@ -558,3 +558,20 @@ def test_string_inference(all_parsers):
558
558
columns = pd .Index (["a" , "b" ], dtype = dtype ),
559
559
)
560
560
tm .assert_frame_equal (result , expected )
561
+
562
+
563
+ def test_accurate_parsing_of_large_integers (all_parsers ):
564
+ # GH#52505
565
+ data = """SYMBOL,MOMENT,ID,ID_DEAL
566
+ AAPL,20230301181139587,1925036343869802844,
567
+ AAPL,20230301181139587,2023552585717889863,2023552585717263358
568
+ NVDA,20230301181139587,2023552585717889863,2023552585717263359
569
+ AMC,20230301181139587,2023552585717889863,2023552585717263360
570
+ AMZN,20230301181139587,2023552585717889759,2023552585717263360
571
+ MSFT,20230301181139587,2023552585717889863,2023552585717263361
572
+ NVDA,20230301181139587,2023552585717889827,2023552585717263361"""
573
+ orders = pd .read_csv (StringIO (data ), dtype = {"ID_DEAL" : pd .Int64Dtype ()})
574
+ assert len (orders .loc [orders ["ID_DEAL" ] == 2023552585717263358 , "ID_DEAL" ]) == 1
575
+ assert len (orders .loc [orders ["ID_DEAL" ] == 2023552585717263359 , "ID_DEAL" ]) == 1
576
+ assert len (orders .loc [orders ["ID_DEAL" ] == 2023552585717263360 , "ID_DEAL" ]) == 2
577
+ assert len (orders .loc [orders ["ID_DEAL" ] == 2023552585717263361 , "ID_DEAL" ]) == 2
0 commit comments