fc44c71d4aa2e8a5ef60effd4bfe7fb82dffbf17,src/pudl/extract/ferc1.py,Ferc1Datastore,get_file,#Ferc1Datastore#Any#Any#,175

Before Change



        
        dbc_path = f"{self.get_dir(year)}/{filename}"
        resource = next(self.get_resources("ferc1", year=year))
        z = zipfile.ZipFile(resource["path"])

        try:
            f = z.open(dbc_path)
        except KeyError:
            raise KeyError(f"{dbc_path} is not available in {year} archive.")

        return f

After Change



    def get_file(self, year: int, filename: str):
        if year not in self._cache:
            self._cache[year] = self.datastore.get_zipfile_resource("ferc1", year=year)
        archive = self._cache[year]
        try:
            return archive.open(f"{self.get_dir(year)}/{filename}")
        except KeyError:
            raise KeyError(f"{filename} not availabe for year {year} in ferc1.")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: catalyst-cooperative/pudl
Commit Name: fc44c71d4aa2e8a5ef60effd4bfe7fb82dffbf17
Time: 2021-01-06
Author: rousik@gmail.com
File Name: src/pudl/extract/ferc1.py
Class Name: Ferc1Datastore
Method Name: get_file


Project Name: catalyst-cooperative/pudl
Commit Name: fc44c71d4aa2e8a5ef60effd4bfe7fb82dffbf17
Time: 2021-01-06
Author: rousik@gmail.com
File Name: src/pudl/extract/ferc1.py
Class Name: Ferc1Datastore
Method Name: get_file


Project Name: catalyst-cooperative/pudl
Commit Name: d22b0ccbccd7c8659c8ec87556a60a8321ccab1c
Time: 2020-11-12
Author: cgosnell@catalyst.coop
File Name: src/pudl/extract/excel.py
Class Name: GenericExtractor
Method Name: load_excel_file


Project Name: catalyst-cooperative/pudl
Commit Name: ead53c9bd3205abfe3fdec30f8e6c8b39ea04329
Time: 2020-11-12
Author: cgosnell@catalyst.coop
File Name: src/pudl/extract/excel.py
Class Name: GenericExtractor
Method Name: load_excel_file