Skip to content

Commit b07f00b

Browse files
committed
Update drop() method docstring to clarify quote handling
- Document that column names are case-sensitive and don't require quotes - Clarify that both quoted and unquoted column names are accepted - Add examples showing both 'col' and 'col' syntax work - Note difference from select() operation behavior
1 parent 4c695ec commit b07f00b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

python/datafusion/dataframe.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,11 +409,20 @@ def select(self, *exprs: Expr | str) -> DataFrame:
409409
def drop(self, *columns: str) -> DataFrame:
410410
"""Drop arbitrary amount of columns.
411411
412+
Column names are case-sensitive and do not require double quotes like
413+
other operations such as `select`. Leading and trailing double quotes
414+
are allowed and will be automatically stripped if present.
415+
412416
Args:
413-
columns: Column names to drop from the dataframe.
417+
columns: Column names to drop from the dataframe. Both 'column_name'
418+
and '"column_name"' are accepted.
414419
415420
Returns:
416421
DataFrame with those columns removed in the projection.
422+
423+
Example Usage:
424+
df.drop('ID_For_Students') # Works
425+
df.drop('"ID_For_Students"') # Also works (quotes stripped)
417426
"""
418427
normalized_columns = []
419428
for col in columns:

0 commit comments

Comments
 (0)