Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup the excel extractor to no longer look for a single file #3200

Closed
wants to merge 1 commit into from

Conversation

cmgosnell
Copy link
Member

@cmgosnell cmgosnell commented Dec 29, 2023

Overview

What problem does this address?
In #3189 we started to use a eia860m archive with zipped files instead of stand xlsx files. which means that we can remove some cruft that handled this in the excel extractor.

What did you change?
I mostly just removed the option for an archive to go grab an individual file. now it always looks for a zipped resource

Testing

How did you make sure this worked? How can a reviewer verify this?

To-do list

Comment on lines 408 to 411
def get_zipfile_resource(self, dataset: str, **filters: Any) -> zipfile.ZipFile:
"""Retrieves unique resource and opens it as a ZipFile."""
# TODO: add some check if the result of get_unique_resource isn't a zip file.
return zipfile.ZipFile(io.BytesIO(self.get_unique_resource(dataset, **filters)))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @rousik ! since the excel extractor no longer needs to deal with a single file in the case of eia860m and can always expect a zipped resource, I stripped out that possibility from the excel extractor. But i thought it might be good to have a very clear message to let you know if you somehow are pointing to a non-zipped resource. Do you know of an easy way to check for that? also, this may be a moot question bc maybe the error message that would result from this would be clear enough.

@cmgosnell
Copy link
Member Author

closing bc maybe we want this functionality in the future.

@cmgosnell cmgosnell closed this Jan 2, 2024
@cmgosnell cmgosnell deleted the excel-extractor-zip-simplify branch January 4, 2024 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant