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

Datetime reverse transform crashes if datetime_format is specified #438

Closed
npatki opened this issue Mar 18, 2022 · 0 comments
Closed

Datetime reverse transform crashes if datetime_format is specified #438

npatki opened this issue Mar 18, 2022 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@npatki
Copy link
Contributor

npatki commented Mar 18, 2022

Environment Details

  • RDT version: 1.0.0 (dev branch)

Error Description

For both UnixTimestampEncoder and OptimizedTimestampEncoder: If you specify a datetime_format string, the transformers are not able to reverse transform the data.

Steps to reproduce

from rdt import get_demo
from rdt.transformers.datetime import UnixTimestampEncoder

# update demo data with a different datetime format
data2 = get_demo()
data2['last_login'] = ['Jun 26, 2021', 'Feb 02, 2021', np.nan, 'Sep 26, 2020', 'Dec 22, 2020']

# use a datetime transformer on this data: give it the explicit format string
ute = UnixTimestampEncoder(datetime_format='%b %d, %Y')
transformed = ute.fit_transform(data2, column='last_login')

# this step crashes
ute.reverse_transform(transformed)

ValueError: time data '1624665600000000000' does not match format '%b %d, %Y' (match)
@npatki npatki added the bug Something isn't working label Mar 18, 2022
@amontanez24 amontanez24 added this to the 1.0.0 milestone Mar 25, 2022
@amontanez24 amontanez24 self-assigned this Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants