Skip to content
Merged
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
30 changes: 15 additions & 15 deletions pandas/tseries/frequencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,11 +394,11 @@ def _get_annual_rule(self) -> str | None:
return None

pos_check = self.month_position_check()
# error: Argument 1 to "get" of "dict" has incompatible type
# "Optional[str]"; expected "str"
return {"cs": "AS", "bs": "BAS", "ce": "A", "be": "BA"}.get(
pos_check # type: ignore[arg-type]
)

if pos_check is None:
return None
else:
return {"cs": "AS", "bs": "BAS", "ce": "A", "be": "BA"}.get(pos_check)

def _get_quarterly_rule(self) -> str | None:
if len(self.mdiffs) > 1:
Expand All @@ -408,21 +408,21 @@ def _get_quarterly_rule(self) -> str | None:
return None

pos_check = self.month_position_check()
# error: Argument 1 to "get" of "dict" has incompatible type
# "Optional[str]"; expected "str"
return {"cs": "QS", "bs": "BQS", "ce": "Q", "be": "BQ"}.get(
pos_check # type: ignore[arg-type]
)

if pos_check is None:
return None
else:
return {"cs": "QS", "bs": "BQS", "ce": "Q", "be": "BQ"}.get(pos_check)

def _get_monthly_rule(self) -> str | None:
if len(self.mdiffs) > 1:
return None
pos_check = self.month_position_check()
# error: Argument 1 to "get" of "dict" has incompatible type
# "Optional[str]"; expected "str"
return {"cs": "MS", "bs": "BMS", "ce": "M", "be": "BM"}.get(
pos_check # type: ignore[arg-type]
)

if pos_check is None:
return None
else:
return {"cs": "MS", "bs": "BMS", "ce": "M", "be": "BM"}.get(pos_check)

def _is_business_daily(self) -> bool:
# quick check: cannot be business daily
Expand Down