-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
675 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,8 +33,10 @@ authors = ["Dmitriy <[email protected]>"] | |
|
||
[tool.poetry.dependencies] | ||
python = "^3.8" | ||
packaging = "^23.1" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
maturin = "^1.0.1" | ||
pre-commit = "^3.0.1" | ||
pytest = "^7.2.1" | ||
pandas = {version = "^2.0.0", extras = ["excel"]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
from datetime import datetime, time | ||
|
||
import pytest | ||
|
||
|
||
@pytest.fixture | ||
def pandas_monkeypatch(): | ||
from python_calamine.pandas import pandas_monkeypatch | ||
|
||
pandas_monkeypatch() | ||
yield | ||
|
||
|
||
@pytest.fixture | ||
def expected_df_ods(): | ||
import pandas as pd | ||
|
||
return pd.DataFrame( | ||
[ | ||
[ | ||
"String", | ||
1, | ||
1.1, | ||
True, | ||
False, | ||
pd.Timestamp("2010-10-10"), | ||
datetime(2010, 10, 10, 10, 10, 10), | ||
time(10, 10, 10), | ||
time(10, 10, 10, 100000), | ||
# duration (255:10:10) isn't supported | ||
# see https://github.com/tafia/calamine/pull/288 and https://github.com/chronotope/chrono/issues/579 | ||
"PT255H10M10S", | ||
], | ||
], | ||
columns=[ | ||
"Unnamed: 0", | ||
"Unnamed: 1", | ||
"Unnamed: 2", | ||
"Unnamed: 3", | ||
"Unnamed: 4", | ||
"Unnamed: 5", | ||
"Unnamed: 6", | ||
"Unnamed: 7", | ||
"Unnamed: 8", | ||
"Unnamed: 9", | ||
], | ||
) | ||
|
||
|
||
@pytest.fixture | ||
def expected_df_excel(): | ||
import pandas as pd | ||
|
||
return pd.DataFrame( | ||
[ | ||
[ | ||
"String", | ||
1, | ||
1.1, | ||
True, | ||
False, | ||
pd.Timestamp("2010-10-10"), | ||
datetime(2010, 10, 10, 10, 10, 10), | ||
time(10, 10, 10), | ||
pd.Timedelta(hours=10, minutes=10, seconds=10, microseconds=100000), | ||
pd.Timedelta(hours=255, minutes=10, seconds=10), | ||
], | ||
], | ||
columns=[ | ||
"Unnamed: 0", | ||
"Unnamed: 1", | ||
"Unnamed: 2", | ||
"Unnamed: 3", | ||
"Unnamed: 4", | ||
"Unnamed: 5", | ||
"Unnamed: 6", | ||
"Unnamed: 7", | ||
"Unnamed: 8", | ||
"Unnamed: 9", | ||
], | ||
) |
Oops, something went wrong.