Search code examples
pythonsnowflake-cloud-data-platform

Host and Port for snowflake-connector-python


I am attempting to establish a connection to Snowflake using the snowflake-connector-python package. I am able to connect to it using the following:

connection = connector.connect(
    user='<my-username>',
    password='<my-password>',
    account='<my-account>'
)

I thought that I would also be able to connect to it by specifying the host and port like this:

connection = connector.connect(
    user='<my-username>',
    password='<my-password>',
    host='<my-host>,
    port=443,
)

However, this does not work. I still have to specify my account.

So, essentially my question is this: what is the use of the host and port parameters? In what kind of situation will users be required to enter these, especially given the fact that only way to use Snowflake is via their cloud offering?

Note: Their documentation is not very clear on this and code in the repo is quite difficult to read.


Solution

  • Hello Minura Punchihewa,

    • I checked the official document of snowflake, related to connector module.
    • It is mentioned that the host is not used anymore, it used for internal use only.
    • There is no need to set it, same goes for port.

    Thus, you will need to mention the account details to establish the connectivity.

    Snowflake Documentation

    Documentation