Skip to content

Commit

Permalink
final test
Browse files Browse the repository at this point in the history
  • Loading branch information
Nate Parsons committed May 10, 2024
1 parent 2e01b4e commit 8c2d4b4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
3 changes: 0 additions & 3 deletions woodwork/deserializers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ def read_table_typing_information(path, typing_info_filename, profile_name):

use_smartopen(file_path, path, transport_params)
with tarfile.open(str(file_path)) as tar:
import pdb

pdb.set_trace()
if "filter" in getfullargspec(tar.extractall).kwonlyargs:
tar.extractall(path=tmpdir, filter="data")
else:
Expand Down
19 changes: 18 additions & 1 deletion woodwork/tests/accessor/test_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ def test_to_csv_S3(sample_df, s3_client, s3_bucket, profile_name):
assert sample_df.ww.schema == deserialized_df.ww.schema


@patch("woodwork.deserializers.deserializer_base.getfullargspec")
@patch("woodwork.deserializers.utils.getfullargspec")
def test_to_csv_S3_errors_if_python_version_unsafe(
mock_inspect,
sample_df,
Expand Down Expand Up @@ -702,6 +702,23 @@ def test_serialize_s3_pickle(sample_df, s3_client, s3_bucket, profile_name):
assert sample_df.ww.schema == deserialized_df.ww.schema


@patch("woodwork.deserializers.deserializer_base.getfullargspec")
def test_serialize_s3_pickle_errors_if_python_version_unsafe(
mock_inspect,
sample_df,
s3_client,
s3_bucket,
):
mock_response = MagicMock()
mock_response.kwonlyargs = []
mock_inspect.return_value = mock_response
sample_df.ww.init()
sample_df.ww.to_disk(TEST_S3_URL, format="pickle", profile_name=None)
make_public(s3_client, s3_bucket)
with pytest.raises(RuntimeError, match="Please upgrade your Python version"):
read_woodwork_table(TEST_S3_URL, profile_name=None)


@pytest.mark.parametrize("profile_name", [None, False])
def test_serialize_s3_parquet(sample_df, s3_client, s3_bucket, profile_name):
sample_df.ww.init()
Expand Down

0 comments on commit 8c2d4b4

Please sign in to comment.