Skip to content

Python Scripts are not aligned correctly #4

@synergit

Description

@synergit

In the section https://cloud.ibm.com/docs/watsonxdata?topic=watsonxdata-con-presto-serv#conn-to-prestpython, the example code is in wrong format. Correct one is

import os
import prestodb
username=os.environ["ENG_USERNAME"]
password=os.environ["ENG_PASSWORD"]
hostname=os.environ["ENG_HOST"]
portnumber=os.environ["ENG_PORT"]
with prestodb.dbapi.connect(
   host=hostname,
   port=portnumber,
   user=username,
   catalog='tpch',
   schema='tiny',
   http_scheme='https',
   auth=prestodb.auth.BasicAuthentication(username,password)
   ) as conn:
   cur = conn.cursor()
   cur.execute('select * from tpch.tiny.customer limit 10')
   rows = cur.fetchall()
   print(rows)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions