Beispiel #1
0
    def insert_et(self, input_dict, database):
        """
        insert_et inserts a record into the status table to show an et job
        has started

        Args:
        input_dict -- a dictionary with the following keys:
            data_date -- the date of the data for the et job
            table_versions -- a string of '<table_name>: <table_version>' pairs

        Returns:
        Boolean of whether the insert worked
        """
        insert_record = StatusRecord(
            data_date=input_dict['data_date'],
            et_status="started",
            table_versions=input_dict['table_versions']
        )
        insert_record.set_updated_at()
        return self.psql.run_sql(
            get_insert_string(insert_record.minimized_record()),
            database,
            'insert',
            params=insert_record.minimized_record()
        )
Beispiel #2
0
    def insert_et(self, input_dict, database):
        """
        insert_et inserts a record into the status table to show an et job
        has started

        Args:
        input_dict -- a dictionary with the following keys:
            data_date -- the date of the data for the et job
            table_versions -- a string of '<table_name>: <table_version>' pairs

        Returns:
        Boolean of whether the insert worked
        """
        insert_record = StatusRecord(
            data_date=input_dict['data_date'],
            et_status="started",
            table_versions=input_dict['table_versions'])
        insert_record.set_updated_at()
        return self.psql.run_sql(get_insert_string(
            insert_record.minimized_record()),
                                 database,
                                 'insert',
                                 params=insert_record.minimized_record())