Skip to content

Commit

Permalink
raise exception in df2sd if column names are too long for SAS; 32 bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
tomweber-sas committed Aug 17, 2023
1 parent 4ff96a2 commit e712235
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion saspy/sasexceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def __init__(self, msg: str):
def __str__(self):
return 'Failure creating SASResults object.\n{}'.format(self.msg)

class SASDFNamesToLong(Exception):
class SASDFNamesToLongError(Exception):
def __init__(self, msg: str):
self.msg = msg

Expand Down
4 changes: 2 additions & 2 deletions saspy/sasiocom.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import logging
logger = logging.getLogger('saspy')

from saspy.sasexceptions import SASDFNamesToLong
from saspy.sasexceptions import SASDFNamesToLongError

try:
from win32com.client import dynamic
Expand Down Expand Up @@ -692,7 +692,7 @@ def dataframe2sasdata(self, df: '<Pandas Data Frame object>', table: str ='a',
columns.append(definition)

if longname:
raise SASDFNamesToLong(Exception)
raise SASDFNamesToLongError(Exception)

sql_values = []
for index, row in df.iterrows():
Expand Down
4 changes: 2 additions & 2 deletions saspy/sasiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from saspy.sasexceptions import (SASHTTPauthenticateError,
SASHTTPconnectionError,
SASHTTPsubmissionError,
SASDFNamesToLong
SASDFNamesToLongError
)

import logging
Expand Down Expand Up @@ -1557,7 +1557,7 @@ def dataframe2sasdata(self, df: '<Pandas Data Frame object>', table: str ='a',
input += ";\n"

if longname:
raise SASDFNamesToLong(Exception)
raise SASDFNamesToLongError(Exception)

code = "data "
if len(libref):
Expand Down
4 changes: 2 additions & 2 deletions saspy/sasioiom.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import logging
logger = logging.getLogger('saspy')

from saspy.sasexceptions import SASDFNamesToLong
from saspy.sasexceptions import SASDFNamesToLongError

try:
import pandas as pd
Expand Down Expand Up @@ -1566,7 +1566,7 @@ def dataframe2sasdata(self, df: '<Pandas Data Frame object>', table: str ='a',
input += ';\n'

if longname:
raise SASDFNamesToLong(Exception)
raise SASDFNamesToLongError(Exception)

code = "data "
if len(libref):
Expand Down
4 changes: 2 additions & 2 deletions saspy/sasiostdio.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import logging
logger = logging.getLogger('saspy')

from saspy.sasexceptions import SASDFNamesToLong
from saspy.sasexceptions import SASDFNamesToLongError

try:
import pandas as pd
Expand Down Expand Up @@ -1804,7 +1804,7 @@ def dataframe2sasdata(self, df: '<Pandas Data Frame object>', table: str ='a',
input += ';\n'

if longname:
raise SASDFNamesToLong(Exception)
raise SASDFNamesToLongError(Exception)

port = kwargs.get('port', 0)

Expand Down

0 comments on commit e712235

Please sign in to comment.