Skip to content

Commit

Permalink
Fix mypy errors after update
Browse files Browse the repository at this point in the history
  • Loading branch information
rcmerlo committed Jan 17, 2025
1 parent 1955294 commit 6cdfdfb
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ taskiq-fastapi = "==0.3.*"
taskiq-redis = "==1.0.2"
typer = "==0.15.*"
uvicorn = { extras = ["standard"], version = "==0.34.*" }
ddtrace = "==2.*"
ddtrace = "==2.19.*"
bytecode = "==0.16.0"
structlog = "==25.1.*"
asgi-correlation-id = "==4.3.4"
Expand Down
2 changes: 1 addition & 1 deletion Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/apps/applets/commands/applet_ema.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class ActivityEventRawRow(RawRow):
def is_last_day_of_month(date: datetime.date):
mdays = calendar.mdays.copy() # type: ignore[attr-defined]
if calendar.isleap(date.year):
mdays[calendar.FEBRUARY] += 1 # type: ignore[attr-defined]
mdays[calendar.FEBRUARY] += 1
return date.day == mdays[date.month]


Expand Down
2 changes: 1 addition & 1 deletion src/apps/jsonld_converter/service/document/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def _get_ld_properties_formatted(self, doc: dict, drop=False, key="reproschema:a

def _get_allow_list(self, doc: dict, drop=False) -> list[str]:
rules = self.attr_processor.get_attr_list(doc, "reproschema:allow", drop=drop) or []
return [rule.get(LdKeyword.id) if isinstance(rule, dict) else rule for rule in rules]
return [rule.get(LdKeyword.id) if isinstance(rule, dict) else rule for rule in rules] # type: ignore

def _is_allowed(self, allow_list: list[str], keys: list[str]) -> bool:
for key in keys:
Expand Down
1 change: 1 addition & 0 deletions src/apps/jsonld_converter/service/document/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ def _get_score_items(cls, expression: str | None) -> list[str]:

@property
def calculation_type(self) -> CalculationType:
assert self.ld_output_type
if self.ld_output_type == "cumulative":
return CalculationType.SUM
return CalculationType(self.ld_output_type)
Expand Down
4 changes: 2 additions & 2 deletions src/apps/jsonld_converter/service/export/activity_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def _build_choices_prop(self, values: SliderValues) -> list:
"schema:value": v,
}
if scores:
choice["schema:score"] = scores[i]
choice["schema:score"] = scores[i] # type: ignore[assignment]
if image:
choice["schema:image"] = image

Expand Down Expand Up @@ -272,7 +272,7 @@ def _build_response_options_prop(self, model: ActivityItemFull) -> dict:
"schema:maxValue": row.max_label,
"schema:minValueImg": row.min_image,
"schema:maxValueImg": row.max_image,
"choices": self._build_choices_prop(row),
"choices": self._build_choices_prop(row), # type: ignore[arg-type]
}
slider_options.append(option)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def export(self) -> str:
operator = self.simple_operator_map.get(type_) # type: ignore[call-overload] # noqa: E501
if isinstance(payload, OptionPayload):
try:
val: int | str = int(payload.option_value) # TODO actualize on PR merge
val: int | str | float = int(payload.option_value) # TODO actualize on PR merge
except ValueError:
val = f'"{payload.option_value}"' # TODO actualize on PR merge
elif isinstance(payload, ValuePayload):
Expand Down

0 comments on commit 6cdfdfb

Please sign in to comment.