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.
I have flat files with timestamp data that can be correctly loaded into CAS tables by using the e8601dt19. informat in the importOptions of the loadTable action (SAS Studio + PROC CAS).
However, I noticed that this informat produces random results when used in the upload_frame() method of the SWAT package. Here is an example:
When I now execute the following part multiple times, the dataframe is sometimes uploaded correctly, sometimes it contains missing values in one or both columns:
# Uploading dataFrame to CAS and viewing table
test = conn.upload_frame(
df,
importoptions=dict(
vars = [
{ 'name' : 'Date1', 'type' : 'datetime', 'informat' : 'e8601dt19.'},
{ 'name' : 'Date2', 'type' : 'datetime', 'informat' : 'e8601dt19.'}
]
),
casout={
'caslib':'casuser',
'name':'test',
'replace':True
}
)
test.head(20)
I have flat files with timestamp data that can be correctly loaded into CAS tables by using the e8601dt19. informat in the importOptions of the loadTable action (SAS Studio + PROC CAS).
However, I noticed that this informat produces random results when used in the upload_frame() method of the SWAT package. Here is an example:
When I now execute the following part multiple times, the dataframe is sometimes uploaded correctly, sometimes it contains missing values in one or both columns:
Possible outcome with 3 missing values:
Viya 2023.12 Python 3.11.7 pandas 2.1.4 swat 1.13.3