Skip to content

[BUG] test_fill_missing_timestamps test case only failed windows-latest, 3.9, ci/envs/latest.yaml #1184

@Zeroto521

Description

@Zeroto521

Brief Description

test_fill_missing_timestamps this test case only failed on windows-latest, 3.9, ci/envs/latest.yaml.
All other test cases were pass, even windows-latest, 3.10, ci/envs/latest.yaml and windows-latest, 3.8, ci/envs/latest.yaml were passed.

    def test_fill_missing_timestamps(timeseries_dataframe):
        """Test that filling missing timestamps works as expected."""
        # Remove random row from the data frame
        random_number = randint(1, len(timeseries_dataframe))
        df1 = timeseries_dataframe.drop(timeseries_dataframe.index[random_number])
    
        # Fill missing timestamps
        result = fill_missing_timestamps(df1, frequency="1H")
    
        # Testing if the missing timestamp has been filled
>       assert len(result) == len(timeseries_dataframe)

System Information

  • OS: windows-latest
  • python: 3.9
  • dependences: ci/envs/latest.yaml

Error Messages

see https://github.com/pyjanitor-devs/pyjanitor/actions/runs/3353734947/jobs/5556766230#step:5:1821

________________________ test_fill_missing_timestamps _________________________
[gw1] win32 -- Python 3.10.6 C:\Miniconda3\envs\test\python.exe

timeseries_dataframe =                        v1
2019-01-01 00:00:00   329
2019-01-01 01:00:00    51
2019-01-01 02:00:00  1950
2019-01-01 03:...1 12:00:00   130
2019-02-11 13:00:00   468
2019-02-11 14:00:00   220
2019-02-11 15:00:00    72

[1000 rows x 1 columns]

    @pytest.mark.timeseries
    def test_fill_missing_timestamps(timeseries_dataframe):
        """Test that filling missing timestamps works as expected."""
        # Remove random row from the data frame
        random_number = randint(1, len(timeseries_dataframe))
        df1 = timeseries_dataframe.drop(timeseries_dataframe.index[random_number])
    
        # Fill missing timestamps
        result = fill_missing_timestamps(df1, frequency="1H")
    
        # Testing if the missing timestamp has been filled
>       assert len(result) == len(timeseries_dataframe)
E       assert 999 == 1000
E        +  where 999 = len(                       v1\n2019-01-01 00:00:00   329\n2019-01-01 01:00:00    51\n2019-01-01 02:00:00  1950\n2019-01-01 03:00:00  1588\n2019-01-01 04:00:00   249\n...                   ...\n2019-02-11 10:00:00   427\n2019-02-11 11:00:00   769\n2019-02-11 12:00:00   130\n2019-02-11 13:00:00   468\n2019-02-11 14:00:00   220\n\n[999 rows x 1 columns])
E        +  and   1000 = len(                       v1\n2019-01-01 00:00:00   329\n2019-01-01 01:00:00    51\n2019-01-01 02:00:00  1950\n2019-01-01 03:00:00  1588\n2019-01-01 04:00:00   249\n...                   ...\n2019-02-11 11:00:00   769\n2019-02-11 12:00:00   130\n2019-02-11 13:00:00   468\n2019-02-11 14:00:00   220\n2019-02-11 15:00:00    72\n\n[1000 rows x 1 columns])

tests\timeseries\test_fill_missing_timestamps.py:32: AssertionError

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions