Skip to content

Commit

Permalink
Made literal keyword-only
Browse files Browse the repository at this point in the history
  • Loading branch information
ugohuche committed Jun 15, 2024
1 parent a3064d8 commit 4d3e722
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions narwhals/_pandas_like/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,13 +309,13 @@ def ends_with(self, suffix: str) -> PandasExpr:
suffix,
)

def contains(self, pattern: str, literal: bool) -> PandasExpr:
def contains(self, pattern: str, *, literal: bool = False) -> PandasExpr:
return reuse_series_namespace_implementation(
self._expr,
"str",
"contains",
pattern,
literal,
literal=literal,
)

def head(self, n: int = 5) -> PandasExpr:
Expand Down
2 changes: 1 addition & 1 deletion narwhals/_pandas_like/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ def ends_with(self, suffix: str) -> PandasSeries:
self._series._series.str.endswith(suffix),
)

def contains(self, pattern: str, literal: bool = False) -> PandasSeries:
def contains(self, pattern: str, *, literal: bool = False) -> PandasSeries:
return self._series._from_series(
self._series._series.str.contains(pat=pattern, regex=not literal)
)
Expand Down

0 comments on commit 4d3e722

Please sign in to comment.