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

Add hostname support to snowflake #39471

Merged
merged 6 commits into from Mar 15, 2024

Conversation

vieux
Copy link
Contributor

@vieux vieux commented Mar 1, 2024

Closes #22133

Description

Add an hostname support to snowflake. When set, it will be used instead of <account_name>.snowflakecomputing.com

How to verify

Describe the steps to verify that the changes are working as expected.

  1. Have a snowflake instance not accessible directly on *.snowflakecomputing.com
  2. When adding the Snowflake connection, select Use hostname and set an hostname.
  3. Validate metabase can connect.

Demo

Screenshot 2024-03-14 at 12 56 23 AM

then, when Use hostname is clicked

Screenshot 2024-03-14 at 12 56 30 AM

Checklist

  • Tests have been added/updated to cover changes in this PR

@vieux vieux requested a review from camsaul as a code owner March 1, 2024 19:06
@paoliniluis paoliniluis requested a review from a team March 1, 2024 20:50
@luizarakaki
Copy link
Contributor

@vieux Can you make this selection automatic? If you can come up with regex rules or something to use a single field for account/hostname, it will be easier to merge the PR.

Automatic selection is likely how we would implement internally.

@luizarakaki
Copy link
Contributor

If automatic selection is really not possible, we would likely implement a toggle close to the account/hostname field

@vieux
Copy link
Contributor Author

vieux commented Mar 8, 2024

@luizarakaki I'm not sure how to have a 100% reliable automatic selection since "account" can use several formats (with and without . for example, if you include the region)

I'll take a stab at implementing a toggle

@qnkhuat qnkhuat requested a review from a team March 12, 2024 07:28
@vieux
Copy link
Contributor Author

vieux commented Mar 14, 2024

@luizarakaki @qnkhuat I updated the PR, please take another look, thanks!

@vieux
Copy link
Contributor Author

vieux commented Mar 14, 2024

The UI is similar to the MongoDB driver with the connection uri.

@vieux vieux changed the title Add alternative hostname support to snowflake Add hostname support to snowflake Mar 14, 2024
@luizarakaki
Copy link
Contributor

Thanks @vieux, the UI looks good. I'll ask for a code review.

Copy link
Contributor

@metamben metamben left a comment

Choose a reason for hiding this comment

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

I can't really comment about the TS code, I'm assuming it's more or less a copy of DatabaseConnectionSectionField.

What's the argument for implementing opt-out instead of opt-in? Opt-in feels more natural for me and I think the code at line 135 of modules/drivers/snowflake/src/metabase/driver/snowflake.clj would be ever so slightly more readable.

It looks good to me otherwise, I have only some trivial remarks. 👍 I'll go ahead and run the tests internally.

@metamben
Copy link
Contributor

@vieux please see the test result of #40137. The inter errors are real. The issue the BE linter is complaining about has been pointed to already, the FE linter issue is "new".

vieux and others added 4 commits March 14, 2024 16:24
Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
@iethree
Copy link
Contributor

iethree commented Mar 15, 2024

frontend code looks good to me 👍

@perivamsi perivamsi merged commit 9c44af4 into metabase:master Mar 15, 2024
2 checks passed
@vieux vieux deleted the vieux/snowflake-alternative-name branch March 18, 2024 12:20
metamben added a commit that referenced this pull request Mar 20, 2024
* Add alternative hostname support to snowflake

* move hostname support out of additional details

* Update modules/drivers/snowflake/src/metabase/driver/snowflake.clj

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>

* Update modules/drivers/snowflake/src/metabase/driver/snowflake.clj

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>

* Update modules/drivers/snowflake/test/metabase/driver/snowflake_test.clj

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>

* opt-in

---------

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
@metamben metamben mentioned this pull request Mar 20, 2024
metamben added a commit that referenced this pull request Mar 20, 2024
* Add alternative hostname support to snowflake

* move hostname support out of additional details

* Update modules/drivers/snowflake/src/metabase/driver/snowflake.clj



* Update modules/drivers/snowflake/src/metabase/driver/snowflake.clj



* Update modules/drivers/snowflake/test/metabase/driver/snowflake_test.clj



* opt-in

---------
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.

Snowflake alternative hostname implementation
5 participants