<commit_before>import logging
import csv
import sqlalchemy


class SchemaTransformer():

    class TableTransformation():
        def __init__(self, stRow):
            self.delete = stRow['Delete'].lower() in ["true", "1"]
            self.old_table = stRow['Table Name']
            self.new_table = stRow['New Table Name']

        def __str__(self):
            return "({0} -> {1}...Delete = {2})".\
                format(self.old_table, self.new_table, str(self.delete))

    class ColumnTransformation():
        def __init__(self, stRow):
            self.delete = stRow['Delete'].lower() in ["true", "1"]
            self.old_table = stRow['Table Name']
            self.old_column = stRow['Column Name']
            self.new_column = stRow['New Column Name']
            self.new_type = stRow['New Column Type']

        def _new_type(self):
            return getattr(sqlalchemy.types, self.new_type)

        def __str__(self):
            return self.old_table + "." + self.old_column
    def schedule_deletion_of_column(col, table):
        st = self.ColumnTransformation({
            'Delete': "true",
            'Table Name': table,
            'Column Name': col,
            'New Column Name': '',
            'New Column Type': ''
        })
        if not self.column_transformations.get(st.old_table):
            # No column transformations exist for the table<commit_msg>Added 'self' keyword to fix bug with schedule_deletion_of_column<commit_after>import logging
import csv
import sqlalchemy


class SchemaTransformer():

    class TableTransformation():
        def __init__(self, stRow):
            self.delete = stRow['Delete'].lower() in ["true", "1"]
            self.old_table = stRow['Table Name']
            self.new_table = stRow['New Table Name']

        def __str__(self):
            return "({0} -> {1}...Delete = {2})".\
                format(self.old_table, self.new_table, str(self.delete))

    class ColumnTransformation():
        def __init__(self, stRow):
            self.delete = stRow['Delete'].lower() in ["true", "1"]
            self.old_table = stRow['Table Name']
            self.old_column = stRow['Column Name']
            self.new_column = stRow['New Column Name']
            self.new_type = stRow['New Column Type']

        def _new_type(self):
            return getattr(sqlalchemy.types, self.new_type)

        def __str__(self):
            return self.old_table + "." + self.old_column
    def schedule_deletion_of_column(self, col, table):
        st = self.ColumnTransformation({
            'Delete': "true",
            'Table Name': table,
            'Column Name': col,
            'New Column Name': '',
            'New Column Type': ''
        })
        if not self.column_transformations.get(st.old_table):
            # No column transformations exist for the table
{'fraction_non_alphanumeric': 0.12592072956857242, 'fraction_numerical': 0.00350754121360926, 'mean_word_length': 2.1724137931034484, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6696975', 'n_tokens_mistral': 820, 'n_tokens_neox': 792, 'n_words': 201}