-
Notifications
You must be signed in to change notification settings - Fork 0
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
Allows optional config for reader and ingeseter #102
Allows optional config for reader and ingeseter #102
Conversation
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 looks pretty good. I'm curious what the use case for a single, non-keyed config string might be. I'm not quite sure how to pass that to the reader/ingester without it being confusing with opts sometimes being a hash and sometimes something else. I'd really prefer to be consistent and only allowing hashes.
@cjcolvar you can always do something like this... # in BatchRunner#read, current code does this...
# reader = config.reader.new(batch.source_location)
# instead, change it to this...
reader_params = [batch.source_location, config.reader_options]
reader = config.reader.new(*reader_params) I don't have strong opinions though. |
As for use case, I was thinking more of flags, e.g. class MyCustomIngester
def initialize(run_derivatives=false)
@run_derivatives = ['true', "TRUE", "1", true, 1].include? run_derivatives
end
end |
I think I'd really like to keep everything as hashes for consistency, for keys, and for easier support for ENV variables (for docker/cloud deployment). |
Right on. Stand by for update. |
Adds 'reader_options' and 'ingester_options' as optional config options. These values are then accessible on IngestTypeConfig object via `#reader_options` and `#ingester_options` accessors. TODO: The BatchRunner (and whichever other objects are responsible for intantiating Reader and Ingester objects) need to pass these options along to construtors for those classes.
50dfb14
to
447b0e6
Compare
@cjcolvar the change doesn't really change anything, other than the dummy value passed in for the optional I started to do some validation on the the |
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.
👍
Adds 'reader_options' and 'ingester_options' as optional config options. These
values are then accessible on IngestTypeConfig object via
#reader_options
and#ingester_options
accessors.TODO: The BatchRunner (and whichever other objects are responsible for
intantiating Reader and Ingester objects) need to pass these options along to
construtors for those classes.