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

None instead of DUMMY_NONEXISTING_PATH when path not set on Dataset instances #290

Open
adamjanovsky opened this issue Dec 8, 2022 · 0 comments
Labels
bug Something isn't working refactoring Need to cleanup and refactor

Comments

@adamjanovsky
Copy link
Collaborator

Currently, objects that inherit from Dataset instance can be initialized without root_dir properly set. In such case, its value is set to DUMMY_NONEXISTING_PATH (constants module) which is a path object meant to substitute None value.

When any operation that involves serialization occurs on the dataset, it is checked that root_dir was properly set by @serialize decorator which raises an exception in case it was not yet set.

What we're trying to achieve is basically None behaviour that could be somewhat tricky to handle with MyPy. ATM, we take the advantage of root_dir always being a Path instance. We should, however, replace DUMMY_NONEXISTING_PATH with None in the future. For some rationale, see https://github.com/crocs-muni/sec-certs/pull/275/commits#discussion_r1042430764

@adamjanovsky adamjanovsky added bug Something isn't working refactoring Need to cleanup and refactor labels Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working refactoring Need to cleanup and refactor
Projects
None yet
Development

No branches or pull requests

1 participant