Skip to content
Merged
Show file tree
Hide file tree
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
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ ci:
- vulture
- vulture-docs
- yamlfix
- pyrefly
- pyrefly-docs

default_install_hook_types: [pre-commit, pre-push, commit-msg]

Expand Down Expand Up @@ -376,3 +378,21 @@ repos:
types_or: [rst]
additional_dependencies: [uv==0.9.5]
stages: [pre-commit]

- id: pyrefly
name: pyrefly
stages: [pre-push]
entry: uv run --extra=dev pyrefly check
language: python
types_or: [python, toml]
pass_filenames: false
additional_dependencies: [uv==0.9.5]

- id: pyrefly-docs
name: pyrefly-docs
stages: [pre-push]
entry: uv run --extra=dev doccmd --no-write-to-file --example-workers 0 --language=python
--command="pyrefly check"
language: python
types_or: [markdown, rst]
additional_dependencies: [uv==0.9.5]
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ optional-dependencies.dev = [
"pylint[spelling]==4.0.4",
"pylint-per-file-ignores==3.2.0",
"pyproject-fmt==2.11.1",
"pyrefly==0.46.1",
"pyright==1.1.407",
"pyroma==5.0.1",
"pytest==9.0.2",
Expand Down
40 changes: 20 additions & 20 deletions src/vws/vws.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,10 @@ def get_target_record(self, target_id: str) -> TargetStatusAndRecord:
target_record_dict = dict(result_data["target_record"])
target_record = TargetRecord(
target_id=target_record_dict["target_id"],
active_flag=target_record_dict["active_flag"],
active_flag=bool(target_record_dict["active_flag"]),
name=target_record_dict["name"],
width=target_record_dict["width"],
tracking_rating=target_record_dict["tracking_rating"],
width=float(target_record_dict["width"]),
tracking_rating=int(target_record_dict["tracking_rating"]),
reco_rating=target_record_dict["reco_rating"],
)
return TargetStatusAndRecord(
Expand Down Expand Up @@ -485,11 +485,11 @@ def get_target_summary_report(self, target_id: str) -> TargetSummaryReport:
database_name=result_data["database_name"],
target_name=result_data["target_name"],
upload_date=date.fromisoformat(result_data["upload_date"]),
active_flag=result_data["active_flag"],
tracking_rating=result_data["tracking_rating"],
total_recos=result_data["total_recos"],
current_month_recos=result_data["current_month_recos"],
previous_month_recos=result_data["previous_month_recos"],
active_flag=bool(result_data["active_flag"]),
tracking_rating=int(result_data["tracking_rating"]),
total_recos=int(result_data["total_recos"]),
current_month_recos=int(result_data["current_month_recos"]),
previous_month_recos=int(result_data["previous_month_recos"]),
)

def get_database_summary_report(self) -> DatabaseSummaryReport:
Expand Down Expand Up @@ -524,18 +524,18 @@ def get_database_summary_report(self) -> DatabaseSummaryReport:

response_data = dict(json.loads(s=response.text))
return DatabaseSummaryReport(
active_images=response_data["active_images"],
current_month_recos=response_data["current_month_recos"],
failed_images=response_data["failed_images"],
inactive_images=response_data["inactive_images"],
name=response_data["name"],
previous_month_recos=response_data["previous_month_recos"],
processing_images=response_data["processing_images"],
reco_threshold=response_data["reco_threshold"],
request_quota=response_data["request_quota"],
request_usage=response_data["request_usage"],
target_quota=response_data["target_quota"],
total_recos=response_data["total_recos"],
active_images=int(response_data["active_images"]),
current_month_recos=int(response_data["current_month_recos"]),
failed_images=int(response_data["failed_images"]),
inactive_images=int(response_data["inactive_images"]),
name=str(object=response_data["name"]),
previous_month_recos=int(response_data["previous_month_recos"]),
processing_images=int(response_data["processing_images"]),
reco_threshold=int(response_data["reco_threshold"]),
request_quota=int(response_data["request_quota"]),
request_usage=int(response_data["request_usage"]),
target_quota=int(response_data["target_quota"]),
total_recos=int(response_data["total_recos"]),
)

def delete_target(self, target_id: str) -> None:
Expand Down