sassoftware / sassoftware/python-swat
read_excel can't read datetime values
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 159
- Forks
- 65
- PR merge metrics
- No merged PRs in 30d
Description
read_excel from SWAT works different that read_excel from Pandas, wich makes me unable to read Date column as a Datetime value.
SWAT: storm_damage = conn.read_excel("D:\Workshop\VIYAPY\storm.xlsx", sheet_name="Storm_Damage", casout=dict(name="STORM_DAMAGE", replace=True, caslib="Public"))
It reads Date column as Varchar
Pandas: sd = pd.read_excel("D:\Workshop\VIYAPY\storm.xlsx", sheet_name="Storm_Damage")
It reads Date column as datetime64
I've tried explicity use converters and it is not helping:
SWAT: storm_damage = conn.read_excel("D:\Workshop\VIYAPY\storm.xlsx", sheet_name="Storm_Damage",
casout=dict(name="STORM_DAMAGE", replace=True, caslib="Public"),
converters={'Date': pd.to_datetime})
Pandas: sd = pd.read_excel("D:\Workshop\VIYAPY\storm.xlsx", sheet_name="Storm_Damage", converters={'Date': pd.to_datetime})
Anything I do I see the action run is:
NOTE: 20: action table.loadTable / path='_f_c15dc565_7ff582b29b88.csv', readAhead=true, importOptions={fileType='csv', vars={Cost={type='double'}, Date={type='varchar'}, Event={type='varchar'}, Summary={type='varchar'}}, locale='EN-us'}, resident=true, promote=false, caslib='_LIB_C15DC565_7FF582B29B88', casOut={name='STORM_DAMAGE', caslib='Public', replace=true}, singlePass=false, noSource=true;
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.
Research direction
Start at the conn.read_excel entry point and inspect the logged table.loadTable action, especially the Date variable's varchar type and CSV import options. Reproduce the reported workbook and verify that the Date column is loaded as a datetime value while preserving the existing read_excel behavior for other columns.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100