sassoftware / python-swat

The SAS Scripting Wrapper for Analytics Transfer (SWAT) package is the Python client to SAS Cloud Analytic Services (CAS). It allows users to execute CAS actions and process the results all from Python.
Other
147 stars 63 forks source link

Incorrect casing for builtins.queryActionSet #156

Open xavierBizoux opened 1 year ago

xavierBizoux commented 1 year ago

I'm struggling using the swat package on MacOS. I'm trying to connect to CAS and I get a 403 error. I turned on some debugging and got the following trace:

PUT https://gelenv-lts.rext03-0029.race.sas.com/cas-shared-default-http/cas/sessions User-Agent: python-requests/2.28.2 Accept-Encoding: gzip, deflate Accept: / Connection: keep-alive Content-Type: application/json Content-Length: 0 Authorization: b'Basic c2J4eGFiOlNBU2xueDMz'

{ "session": "c2cf402c-6fd7-4145-8184-d2f547b1f507" }

POST https://gelenv-lts.rext03-0029.race.sas.com/cas-shared-default-http/cas/sessions/c2cf402c-6fd7-4145-8184-d2f547b1f507/actions/builtins.queryactionset User-Agent: python-requests/2.28.2 Accept-Encoding: gzip, deflate Accept: / Connection: keep-alive Content-Type: application/json Content-Length: 73 Authorization: b'Basic c2J4eGFiOlNBU2xueDMz'

{"actionset": "builtins.help", "_messagelevel": "error", "_apptag": "UI"}

{ "error": "HTTP/1.1 403 Forbidden", "code": "HTTP_403", "details": null, "disposition": null }

I tried the url: https://gelenv-lts.rext03-0029.race.sas.com/cas-shared-default-http/cas/sessions/c2cf402c-6fd7-4145-8184-d2f547b1f507/actions/builtins.queryactionset in my browser and it failed. I then tried to following url: https://gelenv-lts.rext03-0029.race.sas.com/cas-shared-default-http/cas/sessions/c2cf402c-6fd7-4145-8184-d2f547b1f507/actions/builtins.queryActionSet And got a correct answer. I suspect there is an issue with the queryActionSet not using camelCase. Am I correct?

bkemper24 commented 1 year ago

It looks like you are using an older version of the python-swat client, most likely 1.6.1. pip install sometimes does not get the latest release for mac, depending on the mac os version. this is an issue with the wheel file that is currently under investigation.

The latest python-swat release is 1.12.1. Can you please try installing the python-swat client using the python-swat-1.12.1+REST-only-osx-64.tar.gz file from the releases page of this github project to see if that fixes your problem ?

xavierBizoux commented 1 year ago

Hi Barbara,

Updating to the latest release indeed solves the issue.

Is there another way to install on MacOS than using the tar file?

Regards,

Xavier

From: Barbara Kemper @.> Date: Thursday, 13 April 2023 at 15:49 To: sassoftware/python-swat @.> Cc: xavierBizoux @.>, Author @.> Subject: Re: [sassoftware/python-swat] Incorrect casing for builtins.queryActionSet (Issue #156)

It looks like you are using an older version of the python-swat client, most likely 1.6.1. pip install sometimes does not get the latest release for mac, depending on the mac os version. this is an issue with the wheel file that is currently under investigation.

The latest python-swat release is 1.12.1. Can you please try installing the python-swat client using the python-swat-1.12.1+REST-only-osx-64.tar.gz file from the releases page of this github project to see if that fixes your problem ?

— Reply to this email directly, view it on GitHubhttps://github.com/sassoftware/python-swat/issues/156#issuecomment-1506997653, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABD6QFCKNH7CCW6TQOLIUPTXA777VANCNFSM6AAAAAAW5B7RDQ. You are receiving this because you authored the thread.Message ID: @.***>

bkemper24 commented 1 year ago

If you have anaconda, you could do a conda install: conda install -c sas-institute swat That's the only other way I know of.

bkemper24 commented 11 months ago

FYI, the latest release of the python-swat client, 1.13.3 , has added additional wheel files for macosx_11_0_arm64, so you might try the pip install again and see if it gets 1.13.3 for you now instead of 1.6.1