Skip to content
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

Fix deprecation and test #2021

Merged
merged 2 commits into from
Jul 26, 2024
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
4 changes: 0 additions & 4 deletions tiledb/cc/array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ void init_array(py::module &m) {
Array::consolidate(ctx, self.uri(), config);
})
.def("vacuum", &Array::vacuum)
.def("create",
py::overload_cast<const std::string &, const ArraySchema &,
tiledb_encryption_type_t, const std::string &>(
&Array::create))
.def("create",
py::overload_cast<const std::string &, const ArraySchema &>(
&Array::create))
Expand Down
3 changes: 3 additions & 0 deletions tiledb/tests/test_pandas_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@

if not has_pandas():
pytest.skip("pandas>=1.0,<3.0 not installed", allow_module_level=True)
else:
pd = pytest.importorskip("pandas")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't make sense to me - what are we trying to do here? The original line worked correctly.

Copy link
Member Author

@kounelisagis kounelisagis Jul 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

original code is not checking for the pandas version. New code wasn't importing pandas, even if it exists.

Copy link
Contributor

@jdblischak jdblischak Jul 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pd = pytest.importorskip("pandas")
import pandas as pd

The above call to has_pandas()+pytest.skip() already skips the test file if pandas isn't installed (or if it's the wrong version). Thus if has_pandas() evaluates to True, you can simply import pandas directly

tm = pd._testing


def make_dataframe_basic1(col_size=10):
Expand Down
Loading