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
[WIP] feat(cli): Make consistent use of DataHubGraphClientConfig #10466
base: master
Are you sure you want to change the base?
Conversation
@@ -541,6 +546,9 @@ def _relationships_endpoint(self): | |||
def _aspect_count_endpoint(self): | |||
return f"{self.config.server}/aspects?action=getCount" | |||
|
|||
def _session(self) -> Session: | |||
return super()._session |
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 doesn't look right
I don't think it's necessary, unless you want _session to be a method instead of an attr
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.
I was not able in the DataHubGraph object to pull attributes from the super class, so I built this function to surface that. At least the auto-import in Intellij wasn't finding it.
What would be the right way to surface this super
's attribute?
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.
you should be able to do graph._session without any changes
if you really want a method, add a @property
decorator
return get_url_and_token()[1] | ||
|
||
|
||
def get_session_and_host(): |
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.
to reduce the amount of code changes, you could make this call get_default_graph() and then return the tuple
basically keep it as a compatibility shim
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.
Doing that causes a cyclical import dependency. It was my first implementation attempt.
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.
you can put the import inside the get_session_and_host
method to avoid that issue
Deprecates
get_url_and_token()
in favor of a more complete option:load_graph_config()
that returns a fullDatahubClientConfig
.This change was then propagated across previous usages of
get_url_and_token
so that connections to DataHub server from the client respect the full breadth of configuration specified byDatahubClientConfig
.I.e: You can now specify
disable_ssl_verification: true
in your~/.datahubenv
file so that all cli functions to the server work when ssl certification is disabled.Checklist