applying formats using fetch or to_frame makes all DataFrame columns objects
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start by reproducing the behavior with tbl.to_frame(format=True) using the cars example and inspect the resulting SASDataFrame dtypes. Trace the formatting path used by to_frame or fetch, then add coverage showing that only formatted columns become objects while unformatted numeric columns retain numeric types.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
If you have formats on only a few columns in a CAS table and try to apply the formats to the SASDataFrame, the swat package converts all columns to objects, even if the column is a simple number.
For example:
Packages
import swat
import pandas as pd
Connect to CAS
conn = ##connection info
load data to CAS
data = r'https://support.sas.com/documentation/onlinedoc/viya/exampledatasets/cars.csv'
tbl = conn.upload_file(data,
casout = {'name':'cars_upload', 'caslib':'casuser','replace':True},
importoptions={
'stripBlanks':True,
'guessRows':200,
'vars':{
'MSRP':{'format':'dollar16.'},
'Weight':{'format':'comma16.'}
}})
Only the MSRP and Weight columns have a format
tbl.columnInfo()

Pull the CAS table to the client as a SASDataFrame and apply the formats. This works as expected
df = tbl.to_frame(format=True)
df.head()

View the data types of the SASDataFrame

Everything turns into an object. It seems like only the formatted columns should be converted. Numeric columns without formats should remain numbers.
- Lingua principale
- Python
- Stelle
- 159
- Fork
- 66
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di sassoftware/python-swat
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
sassoftware/python-swat#191 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
sassoftware/python-swat#183 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
sassoftware/python-swat#180 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
sassoftware/python-swat#178 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
sassoftware/python-swat#177 · 1 commento ·
Tutte le issue di sassoftware/python-swat
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
fritzprix/libr-agent#2612 ·
I maintainer di solito rispondono entro 1 giorno
-
needs-triage presubmit-gate
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
gke-labs/kube-agents#5001 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
simonw/sqlite-utils#928 ·
I maintainer di solito rispondono entro 3 giorni
-
colorado
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
freelawproject/juriscraper#2405 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
cline/mcp-marketplace#3576 ·