@@ -116,7 +116,7 @@ def test_bento_given_initial_nbytes_returns_expected_metadata() -> None:
116116 assert bento .start == pd .Timestamp ("2020-12-28 13:00:00+0000" , tz = "UTC" )
117117 assert bento .end == pd .Timestamp ("2020-12-29 13:00:00+0000" , tz = "UTC" )
118118 assert bento .limit == 2
119- assert bento .record_count == 2
119+ assert len ( bento .to_ndarray ()) == 2
120120 assert bento .mappings == {
121121 "ESH1" : [
122122 {
@@ -443,7 +443,7 @@ def test_from_dbn_alias() -> None:
443443
444444 # Assert
445445 assert data .schema == Schema .MBO
446- assert data .record_count == 2
446+ assert len ( data .to_ndarray ()) == 2
447447
448448
449449def test_mbo_to_csv_writes_expected_file_to_disk (tmp_path : Path ) -> None :
@@ -671,38 +671,6 @@ def test_mbp_1_to_json_with_all_options_writes_expected_file_to_disk(
671671 )
672672
673673
674- @pytest .mark .parametrize (
675- "schema" ,
676- [
677- s
678- for s in Schema
679- if s
680- not in (
681- Schema .OHLCV_1H ,
682- Schema .OHLCV_1D ,
683- Schema .STATUS ,
684- Schema .STATISTICS ,
685- Schema .DEFINITION ,
686- Schema .GATEWAY_ERROR ,
687- Schema .SYMBOL_MAPPING ,
688- )
689- ],
690- )
691- def test_bento_len (schema : Schema ) -> None :
692- """
693- Check that calling `len()` on a Bento returns
694- the record count.
695- """
696- # Arrange
697- stub_data = get_test_data (schema = schema )
698-
699- # Act
700- bento = Bento .from_bytes (data = stub_data )
701-
702- # Assert
703- assert len (bento ) == bento .record_count
704-
705-
706674@pytest .mark .parametrize (
707675 "schema" ,
708676 [
@@ -732,7 +700,7 @@ def test_bento_repr(schema: Schema) -> None:
732700 bento = Bento .from_bytes (data = stub_data )
733701
734702 # Assert
735- assert repr (bento ) == f"<Bento(schema={ schema } , record_count= { bento . record_count } )>"
703+ assert repr (bento ) == f"<Bento(schema={ schema } )>"
736704
737705
738706def test_bento_iterable () -> None :
@@ -820,6 +788,6 @@ def test_bento_compression_equality(schema: Schema) -> None:
820788 zstd_bento = Bento .from_bytes (zstd_stub_data )
821789 dbn_bento = Bento .from_bytes (dbn_stub_data )
822790
823- assert zstd_bento .record_count == dbn_bento .record_count
791+ assert len ( zstd_bento .to_ndarray ()) == len ( dbn_bento .to_ndarray ())
824792 assert zstd_bento .metadata == dbn_bento .metadata
825793 assert zstd_bento .reader .read () == dbn_bento .reader .read ()
0 commit comments