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

Issues with datetime format '%Y-%m-%d %H:%M:%S %Z'. #133

Closed
DanielAvdar opened this issue Feb 26, 2024 · 1 comment
Closed

Issues with datetime format '%Y-%m-%d %H:%M:%S %Z'. #133

DanielAvdar opened this issue Feb 26, 2024 · 1 comment

Comments

@DanielAvdar
Copy link
Contributor

Describe the bug
Issues with datetime format '%Y-%m-%d %H:%M:%S %Z' inferred as string.

To Reproduce

from src.shmessy import Shmessy

if __name__ == '__main__':
    data_series = pd.Series(['1970-12-31 23:59:59', '1989-12-31 23:59:59']).astype('datetime64[ns]')
    data_series = data_series.dt.strftime('%Y-%m-%d %H:%M:%S %Z')
    df = pd.DataFrame(data_series)
    f_df = Shmessy().fix_schema(df, fix_column_names=True, fallback_to_string=True)
    print(f_df.dtypes)

Expected behavior

from src.shmessy import Shmessy

if __name__ == '__main__':
    data_series = pd.Series(['1970-12-31 23:59:59', '1989-12-31 23:59:59']).astype('datetime64[ns]')
    data_series = data_series.dt.strftime('%Y-%m-%d %H:%M:%S')
    df = pd.DataFrame(data_series)
    f_df = Shmessy().fix_schema(df, fix_column_names=True, fallback_to_string=True)
    print(f_df.dtypes)

Unlike the reproduction example, this is inferred correctly as datetime.

Desktop (please complete the following information):
Check tests in this PR #125.

@ohadmata
Copy link
Owner

should be solved in ver 1.3.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants