Navigating AtScale via Python notebook

Louieceliberti

Does anyone have a sample Python code snippet that connects to the Atscale AI-Link and queries the semantic layer?  I am struggling with dependencies and Python versions on my mac.

 

Thank you!

0

Comments

3 comments

  • Comment author
    Diego Perea

    Standard Python and Jupyter installation will work.
    But, I remember having an issue with the AtScale library version which gave me some grief. I am a Windows user connecting to a non-containerized AtScale server. The AtScale library version that worked for me was 2.8, the default is 3 , I think. When I used version 3 everything seemed fine but at connection time authentication failed.
    Hope this helps.

    0
  • Comment author
    Louieceliberti

    Thank you. That is definitely a start!  Do you know if this will work with the Postgres backed THCDS model from the trial?  I am going to give it a try tomorrow.  Thanks again!

    0
  • Comment author
    Louieceliberti

    Using the notebook from the AtScale site, (https://documentation.atscale.com/assets/files/connect-to-atscale-bf5ff1cac16442051dd8357fa5ccb5ac.ipynb) ,  on a mac with Python 3.9.6

    !pip3 install atscale
    from atscale.client import Client
    from atscale.project import Project
    from atscale.data_model import DataModel
    client = Client(
    server='localhost',
    username='admin'#,
    ## organization=...,
    )
    client.connect()
     
    I receive the error :
    InvalidSchema: No connection adapters were found for 'localhost:10500/login'
     
    Because this is the developer edition of AtScale, I can only connect to the TPCDS model connected to Postgres.  as an added step I ran:
    !pip3 install 'atscale[postgresql]'
     
    But the error remained.  I also tried passing in the engine port '11111', but the error persists.
     
    Thank you
     
    0

Please sign in to leave a comment.