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

オープン
#160 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
api

調査の方向性

レポートにある Python DataFrame と CASTable.eval の例で問題を再現し、その後 CASTable.eval の実装と既存のテストを調べます。完了条件は、無効な SAS 関数がエラーを発生させても、計算された変数や式が castbl.params に残らず、有効な式は引き続き動作することです。

索引モデルが issue の本文から書いたものです。

説明

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; '}

主要言語
Python
スター
159
フォーク
66
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

sassoftware/python-swat のほかの issue

sassoftware/python-swat の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。