Applying formats to compued vars
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start by running the provided Python reproduction with CASTable, computedvars, columnInfo(), and the filtered head() call. Trace how applying the format to the computed time column affects subsequent table operations, and consider the issue done when the format is retained while filtering tbl by price still executes successfully.
Written by the indexing model from the issue text.
Description
Hi,
it would be very helpful if formats could be applied to computed variables - especially when working with date/time columns. The functionality seems to be there, but it's breaking the table reference.
Example: Based on a datetime column I can successfully add a time column that holds the hour of the datetime column.
# example table
conn.datastep.runCode(
code =
'''data test;
format datetime e8601dt19.;
datetime = dhms("03mar2024"d, 9, 50, 0);
price = 101.4;
output;
datetime = dhms("03mar2024"d, 10, 20, 0);
price = 102.5;
output;
run;''',
single = 'yes'
)
tbl = conn.CASTable('test')
# add column containing the hour of the datetime column
tbl['time'] = tbl['datetime'].dt.hour*60*60
# apply time format to new column
tbl.computedvars = [{'name':'time', 'format':'time8.'}]
# check if time format was applied
tbl.columnInfo()
# check if time format works
tbl.head()
Unfortunately, after applying the format as shown above, I can't execute any operations on the table anymore:
tbl[tbl['price']>=102].head()
- Dominant language
- Python
- Stars
- 159
- Forks
- 65
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sassoftware/python-swat
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
sassoftware/python-swat#191 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
sassoftware/python-swat#183 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
sassoftware/python-swat#180 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
sassoftware/python-swat#178 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
sassoftware/python-swat#177 · 1 comment ·
All issues in sassoftware/python-swat
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100