sassoftware / sassoftware/python-swat

swat.functions.concat truncates char columns with different length

Open
#77 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
159
Forks
65
PR merge metrics
No merged PRs in 30d

Description

I have for example two CAS Tables T1 T2, which have the exact same columns. I do this:

df1 = CASTable('T1')
df1["Name"] = "AB"
df1.partition(casout=dict(name='T1', replace=True))
df1 = CASTable('T1')

df2 = CASTable('T2')
df2["Name"] = "CDE"
df2.partition(casout=dict(name='T2', replace=True))
df2 = CASTable('T2')

swat.functions.concat([df1,df2], casout=dict(name='T3'))

The T3 table has then a column "Name" which contains "AB" and "CD" i.e. it has a length of 2 and "CDE" is truncated to "CD".

How can I specify an a-priori length for the "Name" column? Like you do in sas code:

length Name $3.;

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the truncation with swat.functions.concat using the two CASTable examples in the issue. Inspect how concat determines the output column length for CAS tables, then verify that the resulting T3 column preserves the full "CDE" value and supports an explicit length if that is the chosen behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.