Skip to content

Commit

Permalink
fix fdelete call in http access method
Browse files Browse the repository at this point in the history
  • Loading branch information
tomweber-sas committed Oct 18, 2023
1 parent f3dbb73 commit b7ac0ae
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions saspy/sasiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,7 @@ def _authenticate(self, user, pw, authcode, client_id, client_secret, jwt):
ujwt = urllib.parse.quote(jwt)
d1 = "grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&assertion="+ujwt
client = "Basic "+base64.encodebytes((client_id+":").encode(self.encoding)).splitlines()[0].decode(self.encoding)
headers = {"Accept":"application/vnd.sas.compute.session+json",
"Content-Type":"application/x-www-form-urlencoded",
headers = {"Accept":"application/vnd.sas.compute.session+json", "Content-Type":"application/x-www-form-urlencoded",
"Authorization":client}
else:
client_id = "sas.tkmtrb"
Expand Down Expand Up @@ -1854,7 +1853,7 @@ def sasdata2dataframeCSV(self, table: str, libref: str ='', dsopts: dict =None,
if varcat[i] in self._sb.sas_date_fmts + self._sb.sas_time_fmts + self._sb.sas_datetime_fmts:
df[dvarlist[i]] = pd.to_datetime(df[dvarlist[i]], errors='coerce')

code = "data _null_; fdelete(_sp_updn); run;\nfilename _sp_updn;"
code = "data _null_; rc = fdelete('_sp_updn'); run;\nfilename _sp_updn;"

ll = self.submit(code, 'text')
logf += ll['LOG']
Expand Down Expand Up @@ -2078,7 +2077,7 @@ def sasdata2dataframeDISK(self, table: str, libref: str ='', dsopts: dict = None
if varcat[i] in self._sb.sas_date_fmts + self._sb.sas_time_fmts + self._sb.sas_datetime_fmts:
df[dvarlist[i]] = pd.to_datetime(df[dvarlist[i]], errors='coerce')

code = "data _null_; fdelete(_sp_updn); run;\nfilename _sp_updn;"
code = "data _null_; rc = fdelete('_sp_updn'); run;\nfilename _sp_updn;"

ll = self.submit(code, 'text')
logf += ll['LOG']
Expand Down

0 comments on commit b7ac0ae

Please sign in to comment.