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

update() produces 'invalid type promotion' error when used with datetime columns and overwrite=False #9065

Closed
Sereger13 opened this issue Dec 12, 2014 · 3 comments
Labels
Dtype Conversions Unexpected or buggy dtype conversions Internals Related to non-user accessible pandas implementation
Milestone

Comments

@Sereger13
Copy link
Contributor

xref #3025

To reproduce:

    import pandas as pd
    df = pd.DataFrame({'A': [1, 2, 3],
                       'B': ['20140101', nan, '20140101'],
                       'C': [nan, nan, nan]})
    df2 = pd.DataFrame({'A': [1, 2],
                       'B': ['20140104', '20140105'],
                       })
    df.B = pd.to_datetime(df.B, coerce=True)
    df2.B = pd.to_datetime(df2.B, coerce=True)
    df.set_index('A', inplace=True)
    df2.set_index('A', inplace=True)

    #df.update(df2[['B']]) # Works fine
    df.update(df2[['B']], overwrite=False) # Fails with 'invalid type promotion' error.
@jreback
Copy link
Contributor

jreback commented Dec 12, 2014

can u pd.show_versions()

@Sereger13
Copy link
Contributor Author

INSTALLED VERSIONS

commit: None
python: 2.7.5.final.0
python-bits: 32
OS: Linux
OS-release: 2.6.18-238.9.1.el5
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US

pandas: 0.15.0
nose: 1.3.0
Cython: 0.20
numpy: 1.7.1
scipy: 0.13.0
statsmodels: 0.5.0
IPython: 2.2.0
sphinx: 1.1.3
patsy: 0.2.1
dateutil: 1.5
pytz: 2013b
bottleneck: None
tables: 3.1.0
numexpr: 2.2.2
matplotlib: 1.3.1
openpyxl: 1.6.2
xlrd: 0.9.2
xlwt: 0.7.5
xlsxwriter: 0.5.5
lxml: None
bs4: 4.3.1
html5lib: None
httplib2: None
apiclient: None
rpy2: None
sqlalchemy: 0.8.3
pymysql: None
psycopg2: None

@jreback
Copy link
Contributor

jreback commented Dec 12, 2014

this is 'caused' by #3025, IOW. the current machinery is doesn't handle these cases (and why #3025 is neeeded). so closing this and will xref to that issue.

@jreback jreback closed this as completed Dec 12, 2014
@jreback jreback added Dtype Conversions Unexpected or buggy dtype conversions Internals Related to non-user accessible pandas implementation labels Dec 12, 2014
@jreback jreback added this to the 0.16.0 milestone Dec 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dtype Conversions Unexpected or buggy dtype conversions Internals Related to non-user accessible pandas implementation
Projects
None yet
Development

No branches or pull requests

2 participants