forked from snowflakedb/snowpark-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SNOW-1497832 Support reading excel files in snowpandas. As seen in te…
…lemetry. (snowflakedb#1818)
- Loading branch information
1 parent
5823b0f
commit 990c47e
Showing
12 changed files
with
63 additions
and
69 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
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 |
---|---|---|
|
@@ -10,6 +10,7 @@ Input/Output | |
:toctree: pandas_api/ | ||
|
||
read_csv | ||
read_excel | ||
read_json | ||
read_parquet | ||
|
||
|
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
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,38 @@ | ||
# | ||
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved. | ||
# | ||
import modin.pandas as pd | ||
import pandas as native_pd | ||
import pytest | ||
|
||
from tests.integ.modin.sql_counter import SqlCounter, sql_count_checker | ||
from tests.integ.modin.utils import assert_frame_equal | ||
from tests.utils import TestFiles | ||
|
||
|
||
def test_read_excel(resources_path): | ||
test_files = TestFiles(resources_path) | ||
|
||
filename = test_files.test_file_excel | ||
|
||
with SqlCounter(query_count=1): | ||
assert_frame_equal( | ||
pd.read_excel(filename), | ||
native_pd.read_excel(filename), | ||
check_dtype=False, | ||
) | ||
|
||
|
||
@sql_count_checker(query_count=0) | ||
def test_read_excel_no_lib_negative(resources_path): | ||
try: | ||
# skip test if we actually have calamine installed | ||
# this is not a common library to use | ||
import calamine # noqa | ||
except Exception: | ||
test_files = TestFiles(resources_path) | ||
filename = test_files.test_file_excel | ||
with pytest.raises( | ||
ImportError, match="Snowpark Pandas requires an additional package" | ||
): | ||
pd.read_excel(filename, engine="calamine") |
Binary file not shown.
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