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

Inconsistency in parameters to storage_prefix_path #64

Open
nicoavn opened this issue Dec 19, 2022 · 0 comments · May be fixed by #65
Open

Inconsistency in parameters to storage_prefix_path #64

nicoavn opened this issue Dec 19, 2022 · 0 comments · May be fixed by #65
Assignees

Comments

@nicoavn
Copy link

nicoavn commented Dec 19, 2022

This function is expecting the location param to have a value:

    @staticmethod
    def storage_prefix_path(location, filename):
        """Join the location path with the filename to get the full object path"""
        if filename.startswith('.'):
            filename = filename[1:]
        return '/'.join([location.value, filename])

But this usage in storage_delete_file could potentially pass a None value, as the parameter is optional and has None as the default value.

    @classmethod
    @storage_args()
    def storage_delete_file(cls, filename, storage_location=None, storage_profile=None):
        """Remove file data from storage."""
        storage_instance = cls.storage_get_profile(storage_profile)
        storage_instance.delete(path=cls.storage_prefix_path(storage_location, filename)) <------- here, storage_location could be None
        return True
@nicoavn nicoavn linked a pull request Jan 6, 2023 that will close this issue
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.

1 participant