Skip to content

FutureWarning in raw_sql() #62

@cc8734

Description

@cc8734

The following code produces the following FutureWarning, is this an issue?

crsp_m = conn.raw_sql("""
                      select *
                      from crsp.msf_v2 
                      where mthcaldt between '01/01/1970' and '12/31/2017'
                      and sharetype = 'NS'
                      and securitytype = 'EQTY'
                      and securitysubtype = 'COM'
                      and usincflg = 'Y'
                      and (issuertype = 'ACOR' or issuertype = 'CORP')
                      """, date_cols = ['mthcaldt']) 

The warning msg:

/usr/local/sas/jupyterhub/prod/venvs/20240522/lib/python3.11/site-packages/wrds/sql.py:580: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.
full_df = pd.concat([full_df, chunk])

Feel free to reach out with any questions!
Cara Cuiule

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions