covid19-etl/etl/owid2.py
def parse_row(self, pre_row, row):
        """
        Converts a row of a CSV file to data we can submit via Sheepdog

        Args:
            row (list(str)): row of data

        Returns:
            (dict, dict) tuple:
                - location data, in a format ready to be submitted to Sheepdog
                - { "date1": <value>, "date2": <value> } from the row data
        """
        if pre_row is None:
            return None

        pre_date = pre_row[self.header_to_column["date"]]
        pre_country = pre_row[self.header_to_column["location"]]
        pre_iso_code = pre_row[self.header_to_column["iso_code"]]

        if row is not None:
            iso_code = row[self.header_to_column["iso_code"]]

        if row is not None and pre_iso_code == iso_code:
            return None

        summary_location_submitter_id = format_location_submitter_id(pre_country)
        summary_location = {
            "country_region": pre_country,
            "submitter_id": summary_location_submitter_id,
            "projects": [{"code": self.project_code}],
        }

        return (
            summary_location,
            self.create_clinical(pre_row, pre_date, summary_location_submitter_id),
            self.create_summary_socio_demographic(
                pre_row, pre_date, summary_location_submitter_id
            ),
        )

        Converts a row of a CSV file to data we can submit via Sheepdog

        Args:
            row (list(str)): row of data

        Returns:
            (dict, dict) tuple:
                - location data, in a format ready to be submitted to Sheepdog
                - { "date1": <value>, "date2": <value> } from the row data
        
Converts a row of a CSV file to data we can submit via Sheepdog
Converts a row of a CSV file to data we can submit via Sheepdog
def parse_row(self, pre_row, row):
        if pre_row is None:
            return None
        pre_date = pre_row[self.header_to_column["date"]]
        pre_country = pre_row[self.header_to_column["location"]]
        pre_iso_code = pre_row[self.header_to_column["iso_code"]]
        if row is not None:
            iso_code = row[self.header_to_column["iso_code"]]
        if row is not None and pre_iso_code == iso_code:
            return None
        summary_location_submitter_id = format_location_submitter_id(pre_country)
        summary_location = {
            "country_region": pre_country,
            "submitter_id": summary_location_submitter_id,
            "projects": [{"code": self.project_code}],
        }
        return (
            summary_location,
            self.create_clinical(pre_row, pre_date, summary_location_submitter_id),
            self.create_summary_socio_demographic(
                pre_row, pre_date, summary_location_submitter_id
            ),
        )
def parse_row ( self , pre_row , row ) : if pre_row is None : return None pre_date = pre_row [ self . header_to_column [ "date" ] ] pre_country = pre_row [ self . header_to_column [ "location" ] ] pre_iso_code = pre_row [ self . header_to_column [ "iso_code" ] ] if row is not None : iso_code = row [ self . header_to_column [ "iso_code" ] ] if row is not None and pre_iso_code == iso_code : return None summary_location_submitter_id = format_location_submitter_id ( pre_country ) summary_location = { "country_region" : pre_country , "submitter_id" : summary_location_submitter_id , "projects" : [ { "code" : self . project_code } ] , } return ( summary_location , self . create_clinical ( pre_row , pre_date , summary_location_submitter_id ) , self . create_summary_socio_demographic ( pre_row , pre_date , summary_location_submitter_id ) , )
Converts a row of a CSV file to data we can submit via Sheepdog
Converts a row of a CSV file to data we can submit via Sheepdog
"""
        Converts a row of a CSV file to data we can submit via Sheepdog

        Args:
            row (list(str)): row of data

        Returns:
            (dict, dict) tuple:
                - location data, in a format ready to be submitted to Sheepdog
                - { "date1": <value>, "date2": <value> } from the row data
        """
(dict, dict) tuple:
location data, in a format ready to be submitted to Sheepdog
{ "date1": , "date2":  } from the row data
( dict dict ) tuple : location data in a format ready to be submitted to Sheepdog { " date1 " : " date2 " : } from the row data
self
pre_row
row
row of data
row of data