Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
savente93 committed Sep 23, 2024
1 parent ab88ea6 commit 23fdc1a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion hydromt/data_catalog/sources/geodataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def to_stac_catalog(
raise RuntimeError(
f"Unknown extension: {ext} cannot determine media type"
)
except (IndexError, KeyError, CRSError) as e:
except (IndexError, KeyError, CRSError, TypeError) as e:
if handle_nodata == NoDataStrategy.IGNORE:
logger.warning(
"Skipping {name} during stac conversion because"
Expand Down
10 changes: 5 additions & 5 deletions tests/data_catalog/test_data_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,9 +702,9 @@ def test_to_stac(self, data_catalog: DataCatalog):

assert raster_stac_catalog.to_dict() == outcome.to_dict() # type: ignore
source.metadata.crs = (
-3.14
) # manually create an invalid adapter by deleting the crs
assert source.to_stac_catalog(handle_nodata=NoDataStrategy.SKIP) is None
234234234 # manually create an invalid adapter by deleting the crs
)
assert source.to_stac_catalog(handle_nodata=NoDataStrategy.IGNORE) is None

@pytest.fixture()
def zoom_dict(self, tmp_dir: Path, zoom_level_tif: str) -> Dict[str, Any]:
Expand Down Expand Up @@ -1033,7 +1033,7 @@ def test_to_stac_geodataframe(self, data_catalog: DataCatalog):
source.metadata.crs = (
-3.14
) # manually create an invalid adapter by deleting the crs
assert source.to_stac_catalog(handle_nodata=NoDataStrategy.SKIP) is None
assert source.to_stac_catalog(handle_nodata=NoDataStrategy.IGNORE) is None


def test_get_geodataframe_path(data_catalog):
Expand Down Expand Up @@ -1500,7 +1500,7 @@ def test_get_dataframe_variables(df, data_catalog):
assert df.columns == ["city"]


def test_to_stac(self, df: pd.DataFrame, tmp_dir: Path):
def test_to_stac(df: pd.DataFrame, tmp_dir: Path):
uri_df = str(tmp_dir / "test.csv")
name = "test_dataframe"
df.to_csv(uri_df)
Expand Down

0 comments on commit 23fdc1a

Please sign in to comment.