-
Notifications
You must be signed in to change notification settings - Fork 39
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
Refactor local client fs operations to new interface #115
Conversation
Note for reviewers:
I'm not completely sure about the Configuration object I'm using to pass into the specific implementations of the fs clients. Open to suggestions here. |
# TODO(zfry): think about how to do this better | ||
conf = LocalFSClientConfig(root_dir=args.directory) | ||
client = LocalBenchClient(conf) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this (and the same thing im doing in the tests) are what I'm not sure about
open to ideas/suggestions
def __init__(self, config, use_s3=False): | ||
if not use_s3: | ||
self.fs_client = LocalFSClient(config) | ||
else: | ||
raise NotImplementedError("S3 Client not implemented yet") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably should think about a better name here than use_s3
- the intention for now is to write an s3 fs client so we can store results in s3, but I think in the future we'll probably also want to add a client for a nosql db (eg: dynamo)
@@ -176,4 +176,4 @@ def user_login( | |||
|
|||
auth_token = login_cookies.get("Authorization") | |||
|
|||
return auth_token | |||
return auth_token # type: ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needed this to get mypy working - this wasn't related to my change at all.
Before this MR
The local bench client interweaved the data loading operations with the client code which exposed the Bench data objects to the higher-level business logic.
After this MR
There is a new local filesystem (fs) client which abstracts the data loading operations from the business logic. This allows for us to swap in separate data loading client implementation (eg: an S3 client, maybe in the future a dynamo or some other nosql client).