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

feat: Enable custom keyword arguments in Atlas Proxy Client #248

Merged
merged 1 commit into from
Jan 28, 2021

Conversation

mgorsk1
Copy link
Contributor

@mgorsk1 mgorsk1 commented Jan 27, 2021

Summary of Changes

This PR adds a possibility to pass custom kwargs to Atlas proxy client. It be used to fine-tune parameters like timeout or num of retries. Since every client might accept different kind of extra parameters it might be easier to just have custom dictionary complementing

Tests

Documentation

CheckList

Make sure you have checked all steps below to ensure a timely review.

  • PR title addresses the issue accurately and concisely. Example: "Updates the version of Flask to v1.0.2"
  • PR includes a summary of changes.
  • PR adds unit tests, updates existing unit tests, OR documents why no test additions or modifications are needed.
  • In case of new functionality, my PR adds documentation that describes how to use it.
    • All the public functions and the classes in the PR contain docstrings that explain what it does
  • PR passes make test

@mgorsk1
Copy link
Contributor Author

mgorsk1 commented Jan 27, 2021

cc @dechoma

Signed-off-by: mgorsk1 <[email protected]>
@mgorsk1 mgorsk1 force-pushed the feature/kwargs_in_proxy_client branch from 886bb1e to 5ed686e Compare January 27, 2021 11:12
Copy link
Contributor

@dechoma dechoma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@@ -84,6 +85,10 @@ class Config:
# format to be used in tables
WATERMARK_DATE_FORMATS = ['%Y%m%d']

# Custom kwargs that will be passed to proxy client. Can be used to fine-tune parameters like timeout
# or num of retries
PROXY_CLIENT_KWARGS: Dict = dict()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you have example of this config? and is it possible to be leverage by other proxies?

Copy link
Contributor Author

@mgorsk1 mgorsk1 Jan 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It definitely can be leveraged by different proxies. Two examples:

In our case we started small with PROXY_CLIENT_KWARGS = dict(timeout=int(os.getenv('ATLAS_REQUEST_TIMEOUT_SEC', 30))) but there are couple of more params we could add (num_of_retries being one of them)

@mgorsk1
Copy link
Contributor Author

mgorsk1 commented Jan 28, 2021

@feng-tao ok to accept & merge?

@mgorsk1 mgorsk1 merged commit 1e2e3c8 into amundsen-io:master Jan 28, 2021
@mgorsk1
Copy link
Contributor Author

mgorsk1 commented Jan 28, 2021

Thanks ! @feng-tao

@@ -70,7 +70,8 @@ def __init__(self, *,
user: str = 'admin',
password: str = '',
encrypted: bool = False,
validate_ssl: bool = False) -> None:
validate_ssl: bool = False,
client_kwargs: dict = dict()) -> None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should use None as default argument.

@feng-tao
Copy link
Member

feng-tao commented Feb 4, 2021

@mgorsk1 could you take a look at this issue (amundsen-io/amundsen#881) ? Looking at the code, if people doesn't define the config, I think it will break other proxy (neo4j, neptune etc)?

feng-tao added a commit that referenced this pull request Feb 4, 2021
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 this pull request may close these issues.

3 participants