The eval method applies the column expression even if the function is not valid.

Offen
#160 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
45/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
python
Bereich
api

Rechercherichtung

Reproduziere das Problem mit dem Python DataFrame und dem CASTable.eval-Beispiel aus dem Bericht und untersuche anschließend die Implementierung von CASTable.eval sowie die vorhandenen Tests. Als erledigt gilt die Aufgabe, wenn eine ungültige SAS-Funktion einen Fehler auslöst, ohne die berechnete Variable oder den Ausdruck in castbl.params zu hinterlassen, während gültige Ausdrücke weiterhin funktionieren.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Even though you get an error when adding a function that doesn't exist to a CAS table object, it still adds the computation to the object. This causes an error moving forward. You either have to reset the CAS table object, or remove just the bad expression.

I feel that if you get an error when using a SAS function it should not add the expression to the CASTable object.

Example below:

Create demo DataFrame

df = pd.DataFrame({
'SASDate':[18260,18212, 18290, 18201, 18158],
'StrDate':['2009-12-29', '2009-11-11', '2010-01-28', '2009-10-31', '2009-09-18']
})

Upload DataFrame to CAS

castbl = conn.upload_frame(df,
casout = {'name':'date_table',
'caslib':'casuser',
'replace':True})

View params of CASTable object

castbl.params
[output]: {'name': 'DATE_TABLE', 'caslib': 'CASUSER(Peter)'}

Table preview

castbl.head()
image

Eval method bad function

castbl.eval('NewCol = badfunction(SASData)')
image

View params

castbl.params
[output]
{'name': 'DATE_TABLE',
'caslib': 'samples',
'computedvars': ['NewCol'],
'computedvarsprogram': 'NewCol = badfunction(SASData); NewCol = NewCol; '}

Vorherrschende Sprache
Python
Sterne
159
Forks
66
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus sassoftware/python-swat

Alle Issues in sassoftware/python-swat

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.