src/dirbs/importer/base_delta_importer.py
def _delta_multiple_changes_check_single_shard(self, staging_tbl_part_name):
        """Check that same record cannot be added or removed at the same time in a single shard."""
        with utils.create_db_connection(self._db_config) as conn, conn.cursor() as cursor:
            cursor.execute(sql.SQL("""SELECT {pks}
                                        FROM {staging_tbl}
                                    GROUP BY {pks}
                                             HAVING COUNT(DISTINCT(change_type)) > 1""")
                           .format(staging_tbl=sql.Identifier(staging_tbl_part_name),
                                   pks=self._pk_field_columns,
                                   join_tables_on_pk_sql=self._compare_pks_sql()))
            return [x._asdict() for x in cursor.fetchall()]
Check that same record cannot be added or removed at the same time in a single shard.
Check that same record cannot be added or removed at the same time in a single shard.
Check that same record cannot be added or removed at the same time in a single shard .
def _delta_multiple_changes_check_single_shard(self, staging_tbl_part_name):
        with utils.create_db_connection(self._db_config) as conn, conn.cursor() as cursor:
            cursor.execute(sql.SQL("""SELECT {pks}
                                        FROM {staging_tbl}
                                    GROUP BY {pks}
                                             HAVING COUNT(DISTINCT(change_type)) > 1""")
                           .format(staging_tbl=sql.Identifier(staging_tbl_part_name),
                                   pks=self._pk_field_columns,
                                   join_tables_on_pk_sql=self._compare_pks_sql()))
            return [x._asdict() for x in cursor.fetchall()]
def _delta_multiple_changes_check_single_shard ( self , staging_tbl_part_name ) : with utils . create_db_connection ( self . _db_config ) as conn , conn . cursor ( ) as cursor : cursor . execute ( sql . SQL ( """SELECT {pks}
                                        FROM {staging_tbl}
                                    GROUP BY {pks}
                                             HAVING COUNT(DISTINCT(change_type)) > 1""" ) . format ( staging_tbl = sql . Identifier ( staging_tbl_part_name ) , pks = self . _pk_field_columns , join_tables_on_pk_sql = self . _compare_pks_sql ( ) ) ) return [ x . _asdict ( ) for x in cursor . fetchall ( ) ]
Check that same record cannot be added or removed at the same time in a single shard.
Check that same record cannot be added or removed at the same time in a single shard .
"""Check that same record cannot be added or removed at the same time in a single shard."""
self
staging_tbl_part_name