<commit_before>import os

import numpy as np
import pandas as pd
from serenata_toolbox.federal_senate.federal_senate_dataset import FederalSenateDataset
from serenata_toolbox.datasets import fetch

COLUMNS = {
    'net_value': 'reimbursement_value',
    'recipient_id': 'cnpj_cpf',
    'recipient': 'supplier',
}

class Adapter:
    def __init__(self, path):
        self.path = path

    @property
    def dataset(self):
        path = os.path.join(self.path, 'federal_senate_reimbursements.xz')
        if not os.path.exists(path):
            path = self.update_datasets()
        self._dataset = pd.read_csv(path, dtype={'cnpj_cpf': np.str}, encoding = "utf-8")
        self.prepare_dataset()

        return self._dataset

    def prepare_dataset(self):
        self.prepare_cnpj_cpf()
        self.rename_columns()
        self.create_columns()

    def drop_null_cnpj_cpf(self):
        self._dataset[self._dataset['cnpj_cpf'].notnull()]

    def rename_columns(self):
        columns = {v: k for k, v in COLUMNS.items()}
        self._dataset.rename(columns=columns, inplace=True)

    def create_columns(self):
        self._dataset['document_type'] = 'simple_receipt'

    def update_datasets(self):
        os.makedirs(self.path, exist_ok=True)
        federal_senate = FederalSenateDataset(self.path)
        federal_senate.fetch()
        federal_senate.translate()
        federal_senate_reimbursements_path = federal_senate.clean()

        return federal_senate_reimbursements_path<commit_msg>missing rename<commit_after>import os

import numpy as np
import pandas as pd
from serenata_toolbox.federal_senate.federal_senate_dataset import FederalSenateDataset
from serenata_toolbox.datasets import fetch

COLUMNS = {
    'net_value': 'reimbursement_value',
    'recipient_id': 'cnpj_cpf',
    'recipient': 'supplier',
}

class Adapter:
    def __init__(self, path):
        self.path = path

    @property
    def dataset(self):
        path = os.path.join(self.path, 'federal_senate_reimbursements.xz')
        if not os.path.exists(path):
            path = self.update_datasets()
        self._dataset = pd.read_csv(path, dtype={'cnpj_cpf': np.str}, encoding = "utf-8")
        self.prepare_dataset()

        return self._dataset

    def prepare_dataset(self):
        self.drop_null_cnpj_cpf()
        self.rename_columns()
        self.create_columns()

    def drop_null_cnpj_cpf(self):
        self._dataset[self._dataset['cnpj_cpf'].notnull()]

    def rename_columns(self):
        columns = {v: k for k, v in COLUMNS.items()}
        self._dataset.rename(columns=columns, inplace=True)

    def create_columns(self):
        self._dataset['document_type'] = 'simple_receipt'

    def update_datasets(self):
        os.makedirs(self.path, exist_ok=True)
        federal_senate = FederalSenateDataset(self.path)
        federal_senate.fetch()
        federal_senate.translate()
        federal_senate_reimbursements_path = federal_senate.clean()

        return federal_senate_reimbursements_path
{'fraction_non_alphanumeric': 0.10393909301555776, 'fraction_numerical': 0.0006620324395895399, 'mean_word_length': 3.2926136363636362, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6936695', 'n_tokens_mistral': 1017, 'n_tokens_neox': 983, 'n_words': 176}