Skip to content

Commit c42539c

Browse files
[Dev] PandasAnalyzer doesn't actually need pandas (duckdb#49)
This PR fixes duckdb#48 It just sniffs objects to determine if they adhere to a structured type, that doesn't necessarily need pandas This is kind of untested because all our tests require pandas+numpy But I went through the logic called by the pandas analyzer and it seems like pandas/numpy are loaded anyways when we first try to compare with a pandas/numpy class type (i.e there's no `import_cache.pandas.NaT(false)` in the path)
2 parents f640841 + f9b3610 commit c42539c

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/duckdb_py/pandas/analyzer.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -502,12 +502,6 @@ bool PandasAnalyzer::Analyze(py::object column) {
502502
if (sample_size == 0) {
503503
return false;
504504
}
505-
auto &import_cache = *DuckDBPyConnection::ImportCache();
506-
auto pandas = import_cache.pandas();
507-
if (!pandas) {
508-
//! Pandas is not installed, no need to analyze
509-
return false;
510-
}
511505

512506
bool can_convert = true;
513507
idx_t increment = GetSampleIncrement(py::len(column));

0 commit comments

Comments
 (0)