Skip to content

TST/CI: simplify geopandas downstream test to not use fiona #46665

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/deps/actions-38-downstream_compat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ dependencies:
- cftime
- dask
- ipython
- geopandas
- geopandas-base
- seaborn
- scikit-learn
- statsmodels
Expand Down
16 changes: 4 additions & 12 deletions pandas/tests/test_downstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import numpy as np
import pytest

from pandas.compat import is_platform_windows
import pandas.util._test_decorators as td

import pandas as pd
Expand Down Expand Up @@ -224,20 +223,13 @@ def test_pandas_datareader():
pandas_datareader.DataReader("F", "quandl", "2017-01-01", "2017-02-01")


# importing from pandas, Cython import warning
@pytest.mark.filterwarnings("ignore:can't resolve:ImportWarning")
@pytest.mark.xfail(
is_platform_windows(),
raises=ImportError,
reason="ImportError: the 'read_file' function requires the 'fiona' package, "
"but it is not installed or does not import correctly",
strict=False,
)
def test_geopandas():

geopandas = import_module("geopandas")
fp = geopandas.datasets.get_path("naturalearth_lowres")
assert geopandas.read_file(fp) is not None
gdf = geopandas.GeoDataFrame(
{"col": [1, 2, 3], "geometry": geopandas.points_from_xy([1, 2, 3], [1, 2, 3])}
)
assert gdf[["col", "geometry"]].geometry.x.equals(Series([1.0, 2.0, 3.0]))


# Cython import warning
Expand Down