Pytigergraph connection

Hi All,
I am new to TigerGraph. Today i was trying to Establish Initial Connection of my pytigergraph colab with my cluster which i created in tigergraph cloud.

Can anyone tell me how do we get the hostname for the free cluster which i created??
i was trying to run it by copying it from others colab

Imports

import pyTigerGraph as tg

import json

import pandas as pd

Connection parameters

hostName = “https://gsql-101.i.tgcloud.io

userName = “user_1”

password = “XYZ”

conn = tg.TigerGraphConnection(host=hostName, username=userName, password=password, graphname=“MyGraph”)

print(“Connected”)

but even the connection details are wrong i still see the output as Connected. Not sure why

Hi Somnath,

I believe the output shows as connected because there is a print statement that will always print “Connected”. To get more information about the actual connection, can you print(conn) to see the response being returned by the connection?

@Somnath You can try this Google Colab. Just change the parameters. It will allow you to test the connection. Google Colab

In the code, you shared it’s printing a string “connected” which just means while executing you were able to hit that line the print statement was on.

Running a command like:

show_schema = conn.gsql('''LS''')
print(show_schema)

and getting a response will be a better way to test if it’s connected.