@@ -490,86 +490,6 @@ def test_progress_chunk_link_no_next_chunk(self, mock_logger):
490
490
assert result is None
491
491
assert queue ._current_chunk_link is None
492
492
493
- @patch ("databricks.sql.backend.sea.queue.logger" )
494
- def test_progress_chunk_link_success (self , mock_logger , mock_sea_client ):
495
- """Test _progress_chunk_link with successful progression."""
496
- # Create a queue instance without initializing
497
- queue = Mock (spec = SeaCloudFetchQueue )
498
- queue ._current_chunk_link = ExternalLink (
499
- external_link = "https://example.com/data/chunk0" ,
500
- expiration = "2025-07-03T05:51:18.118009" ,
501
- row_count = 100 ,
502
- byte_count = 1024 ,
503
- row_offset = 0 ,
504
- chunk_index = 0 ,
505
- next_chunk_index = 1 ,
506
- http_headers = {"Authorization" : "Bearer token123" },
507
- )
508
- queue ._sea_client = mock_sea_client
509
- queue ._statement_id = "test-statement-123"
510
-
511
- # Setup the mock client to return a new link
512
- next_link = ExternalLink (
513
- external_link = "https://example.com/data/chunk1" ,
514
- expiration = "2025-07-03T05:51:18.235843" ,
515
- row_count = 50 ,
516
- byte_count = 512 ,
517
- row_offset = 100 ,
518
- chunk_index = 1 ,
519
- next_chunk_index = None ,
520
- http_headers = {"Authorization" : "Bearer token123" },
521
- )
522
- mock_sea_client .get_chunk_link .return_value = next_link
523
-
524
- # Call the method directly
525
- SeaCloudFetchQueue ._progress_chunk_link (queue )
526
-
527
- # Verify the client was called
528
- mock_sea_client .get_chunk_link .assert_called_once_with ("test-statement-123" , 1 )
529
-
530
- # Verify debug message was logged
531
- mock_logger .debug .assert_called_with (
532
- f"SeaCloudFetchQueue: Progressed to link for chunk 1: { next_link } "
533
- )
534
-
535
- @patch ("databricks.sql.backend.sea.queue.logger" )
536
- def test_progress_chunk_link_error (self , mock_logger , mock_sea_client ):
537
- """Test _progress_chunk_link with error during chunk fetch."""
538
- # Create a queue instance without initializing
539
- queue = Mock (spec = SeaCloudFetchQueue )
540
- queue ._current_chunk_link = ExternalLink (
541
- external_link = "https://example.com/data/chunk0" ,
542
- expiration = "2025-07-03T05:51:18.118009" ,
543
- row_count = 100 ,
544
- byte_count = 1024 ,
545
- row_offset = 0 ,
546
- chunk_index = 0 ,
547
- next_chunk_index = 1 ,
548
- http_headers = {"Authorization" : "Bearer token123" },
549
- )
550
- queue ._sea_client = mock_sea_client
551
- queue ._statement_id = "test-statement-123"
552
-
553
- # Setup the mock client to raise an error
554
- error_message = "Network error"
555
- mock_sea_client .get_chunk_link .side_effect = Exception (error_message )
556
-
557
- # Call the method directly
558
- result = SeaCloudFetchQueue ._progress_chunk_link (queue )
559
-
560
- # Verify the client was called
561
- mock_sea_client .get_chunk_link .assert_called_once_with ("test-statement-123" , 1 )
562
-
563
- # Verify error message was logged
564
- mock_logger .error .assert_called_with (
565
- "SeaCloudFetchQueue: Error fetching link for chunk {}: {}" .format (
566
- 1 , error_message
567
- )
568
- )
569
-
570
- # Verify the result is None
571
- assert result is None
572
-
573
493
@patch ("databricks.sql.backend.sea.queue.logger" )
574
494
def test_create_next_table_no_current_link (self , mock_logger ):
575
495
"""Test _create_next_table with no current link."""
0 commit comments