ci_mapping/run_pipeline.py
def affiliation_type(self):
        """Find the type (industry, non-industry) of an
        affiliation based on a seed list.
        """
        # Connect to postgresql
        s = self._create_session()
        # Delete rows in AffiliationType
        s.query(AffiliationType).delete()
        s.commit()

        logger.info(self.non_industry)
        # Get affiliation names and IDs
        aff_types = [
            {
                "id": aff.id,
                "type": self._find_non_industry_affiliations(aff.affiliation),
            }
            for aff in s.query(Affiliation)
            .filter(and_(~exists().where(Affiliation.id == AffiliationType.id)))
            .all()
        ]
        logger.info(f"Mapped {len(aff_types)} affiliations.")

        # Store affiliation types
        s.bulk_insert_mappings(AffiliationType, aff_types)
        s.commit()

        self.next(self.data_wrangling)
Find the type (industry, non-industry) of an
        affiliation based on a seed list.
        
Find the type (industry, non-industry) of an
affiliation based on a seed list.
Find the type ( industry non - industry ) of an affiliation based on a seed list .
def affiliation_type(self):
        s = self._create_session()
        s.query(AffiliationType).delete()
        s.commit()
        logger.info(self.non_industry)
        aff_types = [
            {
                "id": aff.id,
                "type": self._find_non_industry_affiliations(aff.affiliation),
            }
            for aff in s.query(Affiliation)
            .filter(and_(~exists().where(Affiliation.id == AffiliationType.id)))
            .all()
        ]
        logger.info(f"Mapped {len(aff_types)} affiliations.")
        s.bulk_insert_mappings(AffiliationType, aff_types)
        s.commit()
        self.next(self.data_wrangling)
def affiliation_type ( self ) : s = self . _create_session ( ) s . query ( AffiliationType ) . delete ( ) s . commit ( ) logger . info ( self . non_industry ) aff_types = [ { "id" : aff . id , "type" : self . _find_non_industry_affiliations ( aff . affiliation ) , } for aff in s . query ( Affiliation ) . filter ( and_ ( ~ exists ( ) . where ( Affiliation . id == AffiliationType . id ) ) ) . all ( ) ] logger . info ( f"Mapped {len(aff_types)} affiliations." ) s . bulk_insert_mappings ( AffiliationType , aff_types ) s . commit ( ) self . next ( self . data_wrangling )
Find the type (industry, non-industry) of an
affiliation based on a seed list.
Find the type ( industry non - industry ) of an affiliation based on a seed list .
"""Find the type (industry, non-industry) of an
        affiliation based on a seed list.
        """ # Connect to postgresql # Delete rows in AffiliationType # Get affiliation names and IDs # Store affiliation types
self