-
Notifications
You must be signed in to change notification settings - Fork 28
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
Set token in inline config #83
Conversation
datadotworld/datadotworld.py
Outdated
@@ -51,12 +51,13 @@ class DataDotWorld(object): | |||
REST API client object | |||
""" | |||
|
|||
def __init__(self, config=None): | |||
def __init__(self, config=None, **kwargs): |
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.
No need to accept auth_token
via kwargs
. If a client wanted to pass the token inline, they could just construct an inline config and pass it in the existing config param here (i.e. dw = DataDotWorld(config=InlineConfig(token))
)
datadotworld/datadotworld.py
Outdated
@@ -114,7 +115,8 @@ def query(self, dataset_key, query, query_type="sql", parameters=None): | |||
raise RuntimeError( | |||
'Error executing query: {}'.format(response.content)) | |||
|
|||
def load_dataset(self, dataset_key, force_update=False, auto_update=False): | |||
def load_dataset(self, dataset_key, force_update=False, auto_update=False, | |||
**kwargs): |
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.
kwargs
doesn't seem to be used here.
datadotworld/__init__.py
Outdated
config_param = (ChainedConfig() | ||
if profile == 'default' | ||
else FileConfig(profile=profile)) | ||
token = kwargs.get('auth_token') |
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 section could be simplified as:
config_param = (ChainedConfig(config_chain=[
InlineConfig(kwargs.get('auth_token')),
EnvConfig(),
FileConfig()])
if profile == 'default'
else FileConfig(profile=profile))
No description provided.