Skip to content

Commit

Permalink
change extract() to downcast()
Browse files Browse the repository at this point in the history
Co-authored-by: Michael J Ward <[email protected]>
  • Loading branch information
emgeee and Michael-J-Ward authored Sep 10, 2024
1 parent 4945661 commit cd04c44
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/dataframe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,8 @@ impl PyDataFrame {
if let Ok(key) = key.extract::<PyBackedStr>() {
// df[col]
self.select_columns(vec![key])
} else if let Ok(tuple) = key.extract::<Py<PyTuple>>() {
} else if let Ok(tuple) = key.downcast::<PyTuple>() {
// df[col1, col2, col3]
let tuple = tuple.bind(key.py());
let keys = tuple
.iter()
.map(|item| item.extract::<PyBackedStr>())
Expand Down

0 comments on commit cd04c44

Please sign in to comment.