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

[CT-410] Handle host name with trailing backslash #302

Closed
JCZuurmond opened this issue Mar 23, 2022 · 11 comments · Fixed by #784
Closed

[CT-410] Handle host name with trailing backslash #302

JCZuurmond opened this issue Mar 23, 2022 · 11 comments · Fixed by #784
Labels
enhancement New feature or request good_first_issue Good for newcomers

Comments

@JCZuurmond
Copy link
Collaborator

Describe the feature

Support complete host name in profile, that is include the https:// before the host.

now: adb-<organisation id>.azuredatabricks.net
complete host: https://adb-<organisation id>.azuredatabricks.net

Describe alternatives you've considered

Keeping it as is.

Additional context

When Databricks refers to DATABRICKS_HOST it means the complete host name, including the https://.

Who will this benefit?

It's more consistent with the Databricks documentation, therefore easier to understand. Also, I insert the host and token as environment variable, if the complete host name is supported, then the Databricks cli works with those environment variables too.

Are you interested in contributing this feature?

Sure. It is a good first issue, I am willing to coach someone too.

@JCZuurmond JCZuurmond added enhancement New feature or request triage labels Mar 23, 2022
@github-actions github-actions bot changed the title Support complete host name in profile [CT-410] Support complete host name in profile Mar 23, 2022
@VersusFacit
Copy link
Contributor

hey @JCZuurmond Appreciate the explanation and generous offer to contribute/coach someone else.

Before I can triage this well, could you do me a favor and let me know where I can learn more about this method documentation-wise. It's not entirely clear to me at the outset that we should match databrick's documentation or that this is the superior method, or if specifying https:// would prevent other users without that http scheme from being explicitly listed.

Looking forward to some pointers from you :)

@jtcohen6
Copy link
Contributor

jtcohen6 commented Apr 3, 2022

I think we may already have logic to handle this, added in #165:

# Prepend https:// if it is missing
host = creds.host
if not host.startswith('https://'):
host = 'https://' + creds.host

That is, you can supply the host with or without https://, it should work either way.

@jtcohen6 jtcohen6 removed the triage label Apr 3, 2022
@JCZuurmond
Copy link
Collaborator Author

Interesting, I'll have a look, I probably made a mistake somewhere

@jtcohen6
Copy link
Contributor

I have noticed that a simple copy-paste of the Databricks host URL often includes a trailing backslash (https://adb-<organisation id>.azuredatabricks.net/), and dbt-spark doesn't do anything to handle that

@JCZuurmond
Copy link
Collaborator Author

@jtcohen6 : Could you make this a good-first-issue?

@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2022

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please remove the stale label or comment on the issue, or it will be closed in 7 days.

@github-actions github-actions bot added the Stale label Dec 7, 2022
@Fleid Fleid added good_first_issue Good for newcomers and removed Stale labels Dec 9, 2022
@tim-steinkuhler
Copy link
Contributor

@JCZuurmond, do you still think this is needed? Looking at @jtcohen6's comment, it seems like providing the full host name is already supported.

@Fokko
Copy link
Contributor

Fokko commented May 18, 2023

@tim-steinkuhler Implemented this in 2021 in #165 :) I think trimming the trailing slash would be a great addition. Would be nice if you have a Databricks instance laying around to test this?

@tim-steinkuhler
Copy link
Contributor

wow, that's a quick response fokko :-), that sounds doable!

@JCZuurmond
Copy link
Collaborator Author

@tim-steinkuhler : Will you implement this issue?

@JCZuurmond JCZuurmond changed the title [CT-410] Support complete host name in profile [CT-410] Handle host name with trailing backslash May 19, 2023
@tim-steinkuhler
Copy link
Contributor

I think I have the correct code, but just having some trouble setting everything up spark correctly, so haven't been able to test it yet :-D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good_first_issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants