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

possible bug/typo in core.py L418 (Dataset.load): reference to global import_set #603

Closed
AmitAronovitch opened this issue Nov 21, 2024 · 1 comment · Fixed by #604
Closed

Comments

@AmitAronovitch
Copy link
Contributor

The current code of Dataset.load() has:

    def load(self, in_stream, format=None, **kwargs):
        ...
        if not import_set:
            raise UnsupportedFormat(f'Format {format} cannot be imported.')

I am not sure what is the purpose of this condition (maybe remainder from older code, or maybe should be fmt.import_set), but as it is now, since there is no local variable of that name, it actually refers to the module-level function import_set.

This means that the condition checked here will never occur (unless the module's namespace is overwritten in runtime), and it is redundant.

@claudep
Copy link
Contributor

claudep commented Nov 22, 2024

Hi Amit,

You are totally right, those two lines should be simply removed IMO. Could you please suggest a patch with this correction?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants