luigi icon indicating copy to clipboard operation
luigi copied to clipboard

`datetime.utcfromtimestamp()` converts `time.time()` to wrong datetime value in `luigi.tools.range.RangeBase`

Open wangzhe258369 opened this issue 4 months ago • 0 comments

datetime.utcfromtimestamp() is used in the source code, which converts time.time() or self.now parameter value to the wrong datetime instance.

https://github.com/spotify/luigi/blob/829fc0c36ecb4d0ae4f0680dec6d538577b249a2/luigi/tools/range.py#L219

now = datetime.utcfromtimestamp(time.time() if self.now is None else self.now)

It should be:

now = datetime.fromtimestamp(time.time() if self.now is None else self.now)

wangzhe258369 avatar Oct 20 '24 07:10 wangzhe258369