Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jingningzhang1/a229270671fbab987b6961a2f0809c0e to your computer and use it in GitHub Desktop.
Save jingningzhang1/a229270671fbab987b6961a2f0809c0e to your computer and use it in GitHub Desktop.
def get_listofusers():
connection3 = sql.connect(
server_hostname=SERVER_HOSTNAME,
http_path=HTTP_PATH,
access_token=ACCESS_TOKEN,
)
cursor3 = connection3.cursor()
cursor3.execute(
f"SELECT DISTINCT userid FROM {DB_NAME}.{USER_TABLE} ORDER BY userid ASC"
)
df = cursor3.fetchall_arrow()
df = df.to_pandas()
cursor3.close()
connection3.close()
return df
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment