Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI test failure in parse_timedelta (got str that cannot be coerced to float) #4583

Open
Tracked by #5818
jakirkham opened this issue Mar 11, 2021 · 1 comment
Open
Tracked by #5818
Labels
flaky test Intermittent failures on CI.

Comments

@jakirkham
Copy link
Member

s = '1-5.888938903808594e-05', default = 'seconds'
1864

1865
    def parse_timedelta(s, default="seconds"):
1866
        """Parse timedelta string to number of seconds
1867
    
1868
        Examples
1869
        --------
1870
        >>> from datetime import timedelta
1871
        >>> from dask.utils import parse_timedelta
1872
        >>> parse_timedelta('3s')
1873
        3
1874
        >>> parse_timedelta('3.5 seconds')
1875
        3.5
1876
        >>> parse_timedelta('300ms')
1877
        0.3
1878
        >>> parse_timedelta(timedelta(seconds=3))  # also supports timedeltas
1879
        3
1880
        """
1881
        if s is None:
1882
            return None
1883
        if isinstance(s, timedelta):
1884
            s = s.total_seconds()
1885
            return int(s) if int(s) == s else s
1886
        if isinstance(s, Number):
1887
            s = str(s)
1888
        s = s.replace(" ", "")
1889
        if not s[0].isdigit():
1890
            s = "1" + s
1891
    
1892
        for i in range(len(s) - 1, -1, -1):
1893
            if not s[i].isalpha():
1894
                break
1895
        index = i + 1
1896
    
1897
        prefix = s[:index]
1898
        suffix = s[index:] or default
1899
    
1900
>       n = float(prefix)
1901
E       ValueError: could not convert string to float: '1-5.888938903808594e-05'
1902

1903
../../../miniconda3/envs/dask-distributed/lib/python3.8/site-packages/dask/utils.py:1468: ValueError

https://github.com/dask/distributed/runs/2088606636

@jrbourbeau jrbourbeau added the flaky test Intermittent failures on CI. label Mar 13, 2021
@jrbourbeau
Copy link
Member

This error also appeared in a different test, distributed/tests/test_client_executor.py::test_map, over in #4563 (see this CI build)

@fjetter fjetter mentioned this issue Feb 17, 2022
51 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flaky test Intermittent failures on CI.
Projects
None yet
Development

No branches or pull requests

2 participants