gouline / dbt-metabase

dbt + Metabase integration
https://pypi.org/project/dbt-metabase/
MIT License
442 stars 63 forks source link

metabase_use_http argument not being used when specified in config.yml #99

Closed jack-cook-repo closed 2 years ago

jack-cook-repo commented 2 years ago

When using a config.yml file and specifying metabase_use_http: True (tried upper and lower case), I end up with the following SSL error (note: running Metabase via http://localhost:3000):

requests.exceptions.SSLError: HTTPSConnectionPool(host='localhost', port=3000): Max retries exceeded with url: /api/session (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1122)')))

After digging into it, the issue was that it was still sending the request via https. I found that here the self.protocol attribute was still being passed as https resulting in the error.

response = requests.request(
            method, f"{self.protocol}://{self.host}{path}", verify=self.verify, **kwargs
        )

Using --metabase_http as a command line argument fixed the issue for me, I believe it just overrides what's here

@click.option(
    "--metabase_http/--metabase_https",
    "metabase_use_http",
    default=False,
    help="use HTTP or HTTPS to connect to Metabase. Default HTTPS",
)

Currently using dbt-metabase==0.8.5

gouline commented 2 years ago

Entirely possible, I don't think a lot of people use it. You're welcome to submit a pull request, should be easy to fix.

jack-cook-repo commented 2 years ago

@gouline #100