8a8e6363ed2857b07a45f66cfc783192c0556c4e,pudl/analysis.py,,merge_on_date_year,#Any#Any#Any#Any#Any#Any#,18

Before Change


            columns to be merged on.  The values from df1 are the ones which
            are retained for any shared, non-merging columns.
    
    if year_col not in df1.columns:
        assert date_col in df1.columns
        assert date_col not in df2.columns
        df1[year_col] = pd.to_datetime(df1[date_col]).dt.year

    if year_col not in df2.columns:
        assert date_col in df2.columns
        assert date_col not in df1.columns
        df2[year_col] = pd.to_datetime(df2[date_col]).dt.year

After Change


    // assert df_date[date_col] is a Date
    // assert df_year[year_col] is a Date
    df_date = df_date.copy()
    df_year = df_year.copy()

    df_date["tmp_year"] = pd.to_datetime(df_date[date_col]).dt.year
    df_year["tmp_year"] = pd.to_datetime(df_year[year_col]).dt.year
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: catalyst-cooperative/pudl
Commit Name: 8a8e6363ed2857b07a45f66cfc783192c0556c4e
Time: 2017-11-20
Author: zane.selvans@catalyst.coop
File Name: pudl/analysis.py
Class Name:
Method Name: merge_on_date_year


Project Name: home-assistant/home-assistant
Commit Name: 17f0fb69bd9449cdafce9e236e342929fdcc6b5b
Time: 2016-11-29
Author: pascal.vizeli@syshack.ch
File Name: homeassistant/components/homematic.py
Class Name:
Method Name: _system_callback_handler


Project Name: open-mmlab/mmdetection
Commit Name: 050614a9b8528de4f8e453aa42d9265206738eb1
Time: 2020-03-11
Author: xvjiarui0826@gmail.com
File Name: mmdet/models/utils/conv_module.py
Class Name: ConvModule
Method Name: __init__